Skip to content

Instantly share code, notes, and snippets.

@n8rzz
Last active October 30, 2021 23:06
Show Gist options
  • Save n8rzz/b22ea2c6d51b46d9fa5eba0521206928 to your computer and use it in GitHub Desktop.
Save n8rzz/b22ea2c6d51b46d9fa5eba0521206928 to your computer and use it in GitHub Desktop.
ui-experiment-props.tsx
export enum ExperimentName {
a = 'a',
b = 'b',
}
export type Experiment = {
[key in ExperimentName]: React.ReactNode;
};
interface IProps extends Experiment {
/**
* Used to identify which component variant is active and should be rendered.
*
* When `true`, node passed via `b` is always rendered.
*/
isExperimentActive: boolean;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment