Use `UnleashToolbarProvider` as a drop-in replacement for `FlagProvider`. Pass your configuration directly and use hooks from the official React SDK.
```tsx {14-17}
import { useFlag, useVariant } from '@unleash/proxy-client-react';
import { UnleashToolbarProvider } from '@unleash/toolbar/react';
import '@unleash/toolbar/toolbar.css';
const config = {
url: 'https://your-unleash.com/api/frontend',
clientKey: 'your-frontend-token',
appName: 'my-app',
refreshInterval: 15
};
function App() {
return (
);
}
function MyComponent() {
const isEnabled = useFlag('my-feature');
const variant = useVariant('my-experiment');
return (
{isEnabled && }
{variant.name === 'variant-a' && }
);
}
```
[View the complete React example on GitHub](https://github.com/Unleash/toolbar/tree/main/examples/react)