react-sdk icon indicating copy to clipboard operation
react-sdk copied to clipboard

Feature Request: `useDecisions` hook

Open ivanngbowtie opened this issue 4 years ago • 2 comments

The current useDecision hook can only work with one feature flag and return only one OptimizelyDecision.

In situation where more than one decision is needed, a useDecisions hook can be used rather than using multiple useDecision hooks. This is especially important for cases where the flags used would change dynamically, for example a switchByFeatureFlags function, which accept multiple flags as argument.

ivanngbowtie avatar Nov 29 '21 02:11 ivanngbowtie

bumping,

what is the recommended way to handle a view that might have multiple a/b tests / assigned decision variants please?

Is there a way to see all the a/b test decisions that a user has been assigned on instead of having to check "useDecision" on each flag and handling "didTimeout" and "isClientReady" on each flag please?

Much appreciated

celineotter avatar Jan 18 '23 22:01 celineotter

I've created an internal work ticket (FSSDK-9620) for this.

Question (and please forgive my in-progress React knowledge): could we separate out by component where useDecision() is used ie react inside each component separately (I'm sort of guess at the implementation too here 😁 )

mikechu-optimizely avatar Aug 25 '23 21:08 mikechu-optimizely