simple-react-validator icon indicating copy to clipboard operation
simple-react-validator copied to clipboard

Is simple-react-validator not compatible with React.memo?

Open henrymcl opened this issue 5 years ago • 2 comments

When I tried to improve performance by separating a field and add React.memo, the error messages stopped showing altogether. Is there a way to make the error messages show even with React.memo?

henrymcl avatar Sep 05 '20 05:09 henrymcl

React.memo prevents rerendering of the component. If the component did not render then the message will not appear. Can you send some code examples, maybe we can come up with a solution?

wztech0192 avatar Oct 18 '20 04:10 wztech0192

Let's say I have a dynamic form with variable fields. They are listed in the form of a table like this: image

Now we I change the value of 1 row, it's ideal that the other rows do not re-render because nothing really is changed. And to achieve that React.memo is often used, but in the case of sharing validator, is it possible?

henrymcl avatar Feb 05 '21 15:02 henrymcl