Tips
Here are some tips you can take into account when creating webcomponents with Atomico
Last updated
Was this helpful?
Here are some tips you can take into account when creating webcomponents with Atomico
Last updated
Was this helpful?
Write the functional component using the first lowercase character, since the functional declaration is not instantiable as a constructor in JSX.
This prevents confusion when identifying the constructor of the component instance.
preferably use useProp in the following cases:
By modifying the prop from inside the component.
By isolating the logic of the prop in a customHook.
In most cases downloading the prop from the first argument of the function is simpler and more declarative, example:
This does not rule out the use within the style tag, since it is sometimes the solution to the definition of conditional styles or variables to the logic and outside the scope of the custom properties.