lundi 28 janvier 2019

React. Which folder to store common methods for component?

How to name this folder and where to store common methods.

handleChange = (e) => {
const { currentTarget: input } = e;
this.setState(prevState => {
  let linkData = { ...prevState.linkData };
  linkData[input.name] = input.value;
  if (input.name === "tag") {
    linkData = this.addTag(linkData);
  }
  return { linkData };
});

};




Aucun commentaire:

Enregistrer un commentaire