kpyszkowski / Nardo-Primitives

Library of React primitive components
MIT License
0 stars 0 forks source link

Form Field component #1

Open kpyszkowski opened 1 year ago

kpyszkowski commented 1 year ago

Overview:

Universal Form Field component to be defined as input, checkbox, radio or textarea.

Structure schema:

image

Features

kpyszkowski commented 1 year ago

To do:

Chores:

Notes

  1. In fact re-renders are unavoidable when input is controlled due to onChange event handler, with use of refs re-renders are gone 🎉 and that the most common use case especially with form libraries (React Hook Form, Formik, etc)
  2. No extra aria attributes required, also no need to bind the label with input (for/id pair) since the input is nested into label so input inherits binding that way
kpyszkowski commented 1 year ago

Props: