The Journey of #100DaysOfCode (@Ayman_Dandan)

๐ƒ๐š๐ฒ ๐Ÿ“๐Ÿ’ of #100DaysOfCode

  • ๐‘ฏ๐’‚๐’๐’…๐’๐’Š๐’๐’ˆ ๐‘ญ๐’๐’“๐’Ž๐’” ๐’Š๐’ ๐‘น๐’†๐’‚๐’„๐’• -

Forms are a common feature in web applications, and React provides a way to handle form elements and user input in a more controlled and efficient manner. React forms can be either controlled or uncontrolled.

โ†’ ๐‚๐จ๐ง๐ญ๐ซ๐จ๐ฅ๐ฅ๐ž๐ ๐‚๐จ๐ฆ๐ฉ๐จ๐ง๐ž๐ง๐ญ๐ฌ:
In controlled components, form data is handled by the React component. The component controls the input via the state.

โ†’ ๐”๐ง๐œ๐จ๐ง๐ญ๐ซ๐จ๐ฅ๐ฅ๐ž๐ ๐‚๐จ๐ฆ๐ฉ๐จ๐ง๐ž๐ง๐ญ๐ฌ:
In uncontrolled components, form data is handled by the DOM itself, and React accesses the data using refs.

1 Like