1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00

docs: add syntax highlighting to react-sdk

This commit is contained in:
Ivar Conradi Østhus 2021-11-09 14:21:07 +01:00 committed by GitHub
parent 0b3c4fd613
commit c4035353a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,7 +15,7 @@ yarn add @unleash/proxy-client-react
Import the provider like this in your entrypoint file (typically index.js/ts):
```
```js
import FlagProvider from '@unleash/proxy-client-react';
const config = {
@ -38,7 +38,7 @@ ReactDOM.render(
To check if a feature is enabled:
```
```js
import { useFlag } from '@unleash/proxy-client-react';
const TestComponent = () => {
@ -55,7 +55,7 @@ export default TestComponent;
To check variants:
```
```js
import { useVariant } from '@unleash/proxy-client-react';
const TestComponent = () => {
@ -76,7 +76,7 @@ export default TestComponent;
Follow the following steps in order to update the unleash context:
```
```js
import { useUnleashContext, useFlag } from '@unleash/proxy-client-react'
const MyComponent = ({ userId }) => {