Closed mgustus closed 5 years ago
There is no memory leak there. Only if you add new rules every time with unique names. But removeValidationRule
function makes sense, I will add it later
The problem is that Rules
is a static collection that is never destroyed. So if I add a rule that uses state
or props
of some component, this component will remain in memory forever.
@mgustus check the 0.6.4 version
great! Thank you 👍
Hi,
After adding a custom validation rule with
ValidatorForm.addValidationRule
incomponentDidMount()
, I think it is reasonable to remove it incomponentWillUnmount()
. It looks like there could be a memory leak because the custom rule function stays in the Rules collection with all its closures. Why there is noValidatorForm.removeValidationRule
?Thanks.