palmerhq / react-register-nodes

Register DOM Nodes in React
MIT License
32 stars 3 forks source link

Full example #1

Closed alex84G closed 5 years ago

alex84G commented 5 years ago

Hi, I saw your article and example on your Blog (https://palmer.net/blog/form-field-scroll-management-in-react).

Can you provide a full example, how to use the manager an target components?

nathanforce commented 5 years ago

Hey thanks for reading!

https://codesandbox.io/s/jjlpm54z0w

Here's a Codesandbox demonstrating the basic usage. It's a bit clunky but it can be composed nicely into your own <FormField> component or something similar.

I'll try to update this to hooks which will hopefully enable a cleaner API.

Thanks!