react-ab-test
react-ab-test copied to clipboard
Default type using useExperiment
- [Expected Behavior] There should be a default type when setting Variants so that if variant is not among the ones that are listed, default component/UI is shown
- [Current Behavior]
- Right now, it don't show anything
My requirements are only fulfilled using useExperiment hook and I can't find anything like defaultVariantName for this hook
This is already supported, but not well documented. The third argument of useExperiment is defaultVariantName:
https://github.com/marvelapp/react-ab-test/blob/73fa6b1b40d19431db76a91dfa7d9e90ad1fc14b/src/hook.jsx#L11
Here's an example: https://codesandbox.io/s/react-ab-test-use-experiment-default-variant-g7iip