This repository was archived by the owner on Apr 4, 2022. It is now read-only.
This repository was archived by the owner on Apr 4, 2022. It is now read-only.
Figure out how to do better onupdate callbacks in React #6
Open
Description
three-elements works fine in React, with the single caveat that you need to work with React refs in order to register update callbacks. This isn't much of a problem, but ideally we'd want to be able to directly assign functions or references to functions to onupdate
and friends from with JSX.
This currently isn't possible because React will swallow the entire attribute, which is discussed at length in this thread and this in the React repository.
Further reading:
- custom-elements-everywhere.com currently lists React as the most problematic with regard to the use of custom elements.
- alligator.io has a useful explanation of custom elements properties vs. attributes.