Skip to content

Commit fb6cdc9

Browse files
authored
fix: remove explicit return type for React OpenFeatureProvider (#1313)
<!-- Please use this template for your pull request. --> <!-- Please use the sections that you need and delete other sections --> ## This PR This PR removes the explicit `JSX.Element` return type from the type signature of the React SDK `OpenFeatureProvider`. `JSX.Element` is narrow for React 19+ as types have widened to include Portals etc. & this was throwing TS compilation errors ### Related Issues Fixes #1307 ### Notes As this is purely a type change I didn't feel it necessary to add additional tests, happy to investigate further if required though Signed-off-by: Sam <[email protected]>
1 parent 9e9d456 commit fb6cdc9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/react/src/provider/provider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ type ProviderProps = {
3131
* @param {ProviderProps} properties props for the context provider
3232
* @returns {OpenFeatureProvider} context provider
3333
*/
34-
export function OpenFeatureProvider({ client, domain, children, ...options }: ProviderProps): JSX.Element {
34+
export function OpenFeatureProvider({ client, domain, children, ...options }: ProviderProps) {
3535
const stableClient = React.useMemo(() => client || OpenFeature.getClient(domain), [client, domain]);
3636

3737
return <Context.Provider value={{ client: stableClient, options, domain }}>{children}</Context.Provider>;

0 commit comments

Comments
 (0)