DEV Community

Scott Barrow
Scott Barrow

Posted on

1

data-reflex-root

If you’re finding janky animations or renders with elements when using reflexes with self-referential data-reflex-root, wrap the children of your root element in a div/span
This helps morphdom…morph
Janky:

<div id='some-id' data-reflex-root='#some-id'>
  some text
  <input data-reflex= 'click->SomeReflex#some_action'>..</div>
</div>
Enter fullscreen mode Exit fullscreen mode

Not janky

<div id='some-id' data-reflex-root='#some-id'>
  <div>
    some text
    <input data-reflex= 'click->SomeReflex#some_action'>..</div>
  </div>
</div>
Enter fullscreen mode Exit fullscreen mode

YMMV

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay