Skip to content

Commit

Permalink
refactor: Change use sync componentDidMount() lifecycle method
Browse files Browse the repository at this point in the history
  • Loading branch information
mikechu-optimizely committed Dec 28, 2023
1 parent 96ccc41 commit a649e6f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ export class OptimizelyProvider extends React.Component<OptimizelyProviderProps,
super(props);
}

async componentDidMount() {
componentDidMount(): void {
this.setUserInOptimizely();
}

async setUserInOptimizely(): Promise<void> {
const { optimizely, userId, userAttributes, user } = this.props;

if (!optimizely) {
Expand Down

0 comments on commit a649e6f

Please sign in to comment.