React implementation

created a customizable code input


Requested feedback

implementation, use of hooks, event handlings

Comments

mankybansal(about 1 year ago)

This is good! One important thing here is that you should never call hooks inside a forEach https://react.dev/warnings/invalid-hook-call-warning I solved this by creating a useState of null refs, and then in a separate CodeInput that renders each individual input component, a useEffect updates the ref array in the parent when it is available.

You must be signed in to post a comment

Get future questions delivered straight to your inbox for free

Sign up and receive instant access to new questions when we publish them.

We‘ll only use your information to deliver new questions and to provide you updates about our product. We‘ll never spam you or sell your information without your consent. Unsubscribe at any time.