Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ function MyReactComponent() {
return (
/* Use SplitFactory to instantiate the SDK and makes it available to nested components */
<SplitFactory config={CONFIG} >
{/* Evaluate splits with SplitTreatments component */}
<SplitTreatments names={['SPLIT_NAME']} >
{({ treatments: { SPLIT_NAME }, isReady }) => {
{/* Evaluate feature flags with SplitTreatments component */}
<SplitTreatments names={['FEATURE_FLAG_NAME']} >
{({ treatments: { FEATURE_FLAG_NAME }, isReady }) => {
// Check SDK readiness using isReady prop
if (!isReady)
return <div>Loading SDK ...</div>;
if (SPLIT_NAME.treatment === 'on') {
if (FEATURE_FLAG_NAME.treatment === 'on') {
// return JSX for on treatment
} else if (SPLIT_NAME.treatment === 'off') {
} else if (FEATURE_FLAG_NAME.treatment === 'off') {
// return JSX for off treatment
} else {
// return JSX for control treatment
Expand Down