0.2.0 • Published 4 years ago

opt-use-ab-hook v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Google Optimize Use AB React Hook

Usage

The following code goes to the variant into Google Optimize

var myABTest = new CustomEvent('ab_myabtest');
window.dispatchEvent(myABTest);

The following code is inside your component

const Component = () => {
  const ab = useAB('myabtest');
  return (ab ? <div>yes</div> : <div>no</div>);
};

License

MIT

Author

Matheus Freire Rabelo

0.2.0

4 years ago

0.1.0

4 years ago