Post #52
873

Лучший способ решить prop drilling в React приложениях
https://blog.logrocket.com/solving-prop-drilling-react-apps/
✍️ @React_lib
https://blog.logrocket.com/solving-prop-drilling-react-apps/
✍️ @React_lib
- 👍 1
RE @react_lib
Showing posts older than #53 · Back to latest




function Checkbox() {
const id = useId();
return (
<>
<label htmlFor={id}>Do you like React?</label>
<input type="checkbox" name="react" id={id} />
</>
);
);
00101 00010001011010101
╰──┬──╯ ╰────────┬────────╯
Fork 5 of 20 id родителя
function NameFields() {
const id = useId();
return (
<div>
<label htmlFor={id + '-firstName'}>First Name</label>
<div>
<input id={id + '-firstName'} type="text" />
</div>
<label htmlFor={id + '-lastName'}>Last Name</label>
<div>
<input id={id + '-lastName'} type="text" />
</div>
</div>
);
}




