lmc-eu / spirit-web-twig-bundle

[READ-ONLY] Spirit Design System Web Twig components
0 stars 0 forks source link

Uncontrolled components #7

Open literat opened 2 months ago

literat commented 2 months ago

In Twig we want to have Uncontrolled components similar to React. The point of uncontrolled components in twig, as in react, is that the user cannot control their state. In this case, control of the components is hardwired via the data-spirit-toggle data attribute to the component and cannot be turned off. So the developer will either use a controlled component and hang or add all the attributes himself or an uncontrolled component where javascript will be directly available.