Skip to content

Commit

Permalink
fix: default context for painted door experiment
Browse files Browse the repository at this point in the history
There are multiple places where attributes of the object provided by `usePaintedDoorExperimentContext()` are assumed to exist. This provides default (null) values for those attributes when creating the context.
  • Loading branch information
brian-smith-tcril committed Oct 13, 2023
1 parent 82ff0d7 commit aa34eee
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ export const useIsEnterpriseUser = () => {
return enterpriseUser;
};

export const PaintedDoorExperimentContext = React.createContext();
export const PaintedDoorExperimentContext = React.createContext({
experimentVariation: null,
isPaintedDoorWidgetBtnVariation: null,
experimentLoading: null,
});

export const PaintedDoorExperimentProvider = ({ children }) => {
const [experimentData, setExperimentData] = module.state.experimentData({
Expand Down

0 comments on commit aa34eee

Please sign in to comment.