MCPcopy Create free account
hub / github.com/dailydotdev/apps / WithExperiment

Function WithExperiment

packages/shared/src/components/withExperiment.tsx:31–41  ·  view source on GitHub ↗
(props: Props)

Source from the content-addressed store, hash-verified

29 },
30): ComponentType<Props> => {
31 const WithExperiment = (props: Props): ReactElement => {
32 const featureValue = useFeature(options.feature);
33
34 if (featureValue !== options.value) {
35 const FallbackComponent = options?.fallback;
36
37 return FallbackComponent ? <FallbackComponent {...props} /> : null;
38 }
39
40 return <WrappedComponent {...props} />;
41 };
42
43 WithExperiment.displayName = 'WithExperiment';
44

Callers

nothing calls this directly

Calls 1

useFeatureFunction · 0.90

Tested by

no test coverage detected