Skip to content

Instantly share code, notes, and snippets.

Forked from prokizzle/ExampleComponent.js
Created July 14, 2021 00:55
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
useFeatureFlag Example
import React from 'react';
import useFeatureFlag from './useFeatureFlag';
import RecommendationsComponent from './Recommendations.js';
const {
DecoratedComponent: Recommendations,
featureEnabled: recommendationsFeatureEnabled,
} = useFeatureFlag({
Component: RecommendationsComponent,
const ExampleComponent = () => {
const pageTitle = recommendationsFeatureEnabled ? 'Recommendations' : 'Saved Items';
return <div>
<Recommendations />
<Dependency recommendations={recommendations} />
import React from 'react';
const Recommendations = ({ featureEnabled }) => {
if (!featureEnabled) {
return <div>Page Not Found</div>
return <div>
export default Recommendations;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment