Skip to content

Commit f202db2

Browse files
Cl00e9mentSaccoccio Clement
andauthored
Support for React 18 (#12)
* added support for React 18 * typo * formatted tables * bumped version Co-authored-by: Saccoccio Clement <c.saccoccio@lectra.com>
1 parent f514643 commit f202db2

3 files changed

Lines changed: 23 additions & 21 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ import FlagsConsumer from "./src/FlagsConsumer";
33
# Changelog
44
All notable changes to this project are documented in this file.
55

6+
## [1.2.0] - 2020-11-30
7+
This release allows you to use ld-react-feature-flags with React 18 without a warning when installing.
8+
69
## [1.1.0] - 2020-11-30
710
This release allows you to use ld-react-feature-flags with React 17 without a warning when installing.
811

README.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ ReactDOM.render(
3232
);
3333
```
3434

35-
Prop | Type | Required | Description
36-
--- | --- | --- | ---
37-
user | Object | true | User information
38-
clientkey | String | true | Your LaunchDarkly secret key
39-
onFlagsChange | function | false | Handler for flag change
40-
loadingComponent | Component | false | Loading component / string
35+
| Prop | Type | Required | Description |
36+
|------------------|-----------|----------|------------------------------|
37+
| user | Object | true | User information |
38+
| clientkey | String | true | Your LaunchDarkly secret key |
39+
| onFlagsChange | function | false | Handler for flag change |
40+
| loadingComponent | Component | false | Loading component / string |
4141

4242
### Flags
4343
All `Flags` components get the _ldClient_ instance thanks to the `FlagsProvider` component.
@@ -53,13 +53,12 @@ You have the control on what will be rendered:
5353
* If the flag isn't active, nothing will be rendered unless you pass a component as fallback by the `fallbackRender` props.
5454

5555

56-
Prop | Type | Required | Description
57-
--- | --- | --- | ---
58-
flag | String | true | The flag to check
59-
children | Element/Component | false | Return the component if the flag given by props is active
60-
renderOn | Function | false | Return the given component if the flag is active
61-
fallbackRender | Function | false | Return the given component if the flag is inactive
62-
56+
| Prop | Type | Required | Description |
57+
|----------------|-------------------|----------|-----------------------------------------------------------|
58+
| flag | String | true | The flag to check |
59+
| children | Element/Component | false | Return the component if the flag given by props is active |
60+
| renderOn | Function | false | Return the given component if the flag is active |
61+
| fallbackRender | Function | false | Return the given component if the flag is inactive |
6362

6463
#### with children props
6564

@@ -127,11 +126,11 @@ Same as `Flags` components but in a Higher Order Component way.
127126
`WithFlags([flag])([ComponentToRenderIfTrue][ComponentToRenderIfFalse])`
128127

129128

130-
Arguments | Type | Required | Description
131-
--- | --- | --- | ---
132-
flag | String | true | The flag to check
133-
ComponentToRenderIfTrue | React Component | true | The React component to render if the flag is true or is a multivariant flag
134-
ComponentToRenderIfFalse | React Component | false | The React component to render if the flag is false
129+
| Arguments | Type | Required | Description |
130+
|--------------------------|-----------------|----------|-----------------------------------------------------------------------------|
131+
| flag | String | true | The flag to check |
132+
| ComponentToRenderIfTrue | React Component | true | The React component to render if the flag is true or is a multivariant flag |
133+
| ComponentToRenderIfFalse | React Component | false | The React component to render if the flag is false |
135134

136135
#### Component render based on flag value
137136

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lectra/ld-react-feature-flags",
3-
"version": "1.1.0",
3+
"version": "1.2.0",
44
"description": "Integrate Launch Darkly in your React app in a breeze",
55
"contributors": [
66
{
@@ -37,8 +37,8 @@
3737
},
3838
"peerDependencies": {
3939
"prop-types": "^15.6.2",
40-
"react": "^16.3.0 || ^17",
41-
"react-dom": "^16.3.0 || ^17"
40+
"react": "^16.3.0 || ^17 || ^18",
41+
"react-dom": "^16.3.0 || ^17 || ^18"
4242
},
4343
"devDependencies": {
4444
"@types/react": "^16.9.23",

0 commit comments

Comments
 (0)