-
@MrWook ... I need your help.
So I get 2 problems with this: - The debounce timeout doesn't work at all, the function is invoked instantly on every key press. I get the console message "Matcher already exists", which relates to the pwned matcher. The official documentation does not have react examples and I cannot find any other examples online. What am I doing wrong here? Thanks. References: - https://zxcvbn-ts.github.io/zxcvbn/guide/examples/#debounce https://zxcvbn-ts.github.io/zxcvbn/guide/lazy-loading/#webpack |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey, i don't have a react example because i never really used it.
The configuration of zxcvbn should be above it. As i understand from various react source on the internet you don't want to add a debounce function in useEffect because its triggered multiple times https://stackoverflow.com/questions/61785903/problems-with-debounce-in-useeffect |
Beta Was this translation helpful? Give feedback.
Hey, i don't have a react example because i never really used it.
But what i can tell is you doing it kind of wrong.
useEffect
should be triggered twice in dev mode. This means that you currently execute the addMatcher function twice too in dev mode.All this configuration should be done above the react class. For example if you have this kind of react class which is from the documentation: