Sometimes you want to render components outside
id="root". It may happen when you're working on some components that use
absolute/fixed/staticpositions in css - these could be modals, alerts or prompts.
This can be achieved by usage of
don't repeat yourself. Don't use this API everywhere and stop copying the logic all the time. It's a good idea to create a hook for that.
The hook created by us can be used in the following way:
Check implementation below to understand the power of encapsulation.
- 1. Rendering
- 2. Forms
- 3. Events
- 4. Guards