Commit f57c9ed
authored
fix(types): Align FlagsmithProvider children prop type with React.ReactNode (#317)
Ensures the `children` prop in `FlagsmithProvider`'s type definition (`FlagsmithContextType`) is correctly set to `React.ReactNode` in both the implementation (`react.tsx`) and the declaration file (`react.d.ts`).
Adds a type test to verify that `FlagsmithProvider` compiles successfully when provided with a plain string child, which is a valid `React.ReactNode`. This test would fail compilation if the type were incorrectly restricted (e.g., to `ReactElement | ReactElement[]`).1 parent ce0412b commit f57c9ed
2 files changed
+12
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
125 | 136 | | |
0 commit comments