C
C
cester2018-02-13 16:28:45
JavaScript
cester, 2018-02-13 16:28:45

How to solve eslint warning, react?

Good afternoon! Please tell me how to improve the method in react?

handleChange = (data) => {
  if (data.file) {
  data.fileContent = data.file;
  data.filename = data.file && data.file.name;
}

The problem is that I'm assigning a value to a parameter
Eslint swears at this snippetdata.fileContent
ESLint: Assignment to property of function parameter 'data'. (no-param-reassign)

I will be grateful..

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question