Skip to content

Commit

Permalink
render children even if fbClient is not initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmos-explorer committed Jul 1, 2024
1 parent 175a1b5 commit 790e507
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@featbit/react-client-sdk",
"version": "1.0.4",
"version": "1.0.5",
"description": "FeatBit client SDK for React",
"keywords": [
"FeatBit",
Expand Down
5 changes: 0 additions & 5 deletions src/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,6 @@ class FbProvider extends Component<PropsWithChildren<ProviderConfig>, ProviderSt
render() {
const {flags, flagKeyMap, fbClient, error} = this.state;

// Conditional rendering when fbClient is null
if (fbClient === undefined) {
return null; // or Loading Indicator or any other placeholder
}

return <Provider value={{ flags, flagKeyMap, fbClient, error }}>{ this.props.children }</Provider>;
}
}
Expand Down

0 comments on commit 790e507

Please sign in to comment.