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

Add ability to conditionally render experimentation hooks

Open PepijnSenders opened this issue 3 years ago • 1 comments

Description

We'd like to be able to render useExperiment() and the other hooks conditionally. This PR will add the ability for people to run useExperiment('experiment_key', { disabled: true }) to skip the execution of the hook.

PepijnSenders avatar Aug 23 '22 15:08 PepijnSenders

This is a solid addition. I've added a Jira ticket for this (FSSDK-9627; need to add tests, etc)

I see you've already signed the Contributor License Agreement. Thanks.

mikechu-optimizely avatar Aug 29 '23 13:08 mikechu-optimizely

This indeed could be a great addition to the hooks. However hook structure has been changed, and this version of the code goes agains the Rules of Hook

I would suggest work on the latest master and follow the Rules of Hook accordingly.

Thank you!

junaed-optimizely avatar Nov 08 '24 11:11 junaed-optimizely