Skip to content

Need help with react implementation of pwned and lazy loading #117

Answered by MrWook
U-4-E-A asked this question in Q&A
Discussion options

You must be logged in to vote

Hey, i don't have a react example because i never really used it.
But what i can tell is you doing it kind of wrong. useEffect should be triggered twice in dev mode. This means that you currently execute the addMatcher function twice too in dev mode.
All this configuration should be done above the react class. For example if you have this kind of react class which is from the documentation:

class NameForm extends React.Component {
  constructor(props) {
    super(props);
    this.state = {value: ''};

    this.handleChange = this.handleChange.bind(this);
    this.handleSubmit = this.handleSubmit.bind(this);
  }

  handleChange(event) {
    this.setState({value: event.target.value});
  }
 …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MrWook
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants