New Function error in react

Action: for example, new Function (), VS code warning "The Function constructor is eval" was used in react (16.5.2), and then the browser reported an error when the relevant code was executed through an event.
can"t the structure body of a function be eval? Why? Thank you!

Aug.18,2021

according to your description, this has nothing to do with react itself. Can you post the code?

I can only guess here that the guess is due to your vscode lint plugin (such as js hint)). You can disable it or choose another way to write it.

Menu