Does this work with other React-like libs like Preact, Inferno, etc?
AndyOGo opened this issue · comments
I'm curious if that is compatible with Preact and Inferno and so on.
In theory it should work if React is aliased 🤔
@AndyOGo Intuitively I think the answer is yes but I haven't checked yet. If you'd like to test on your own, we can add the answer to the docs. Otherwise I may be able to get around to checking sooner or later, but I can't give a timeline. My development's been on hiatus but I'll likely resume in the next week or so.
I did a quick review of what we depend on from React:
require('react')
returns the library asReact
React
has acreateElement
function- Element excepts a
ref
callback prop which receives the DOM element for the div - (Optional but desired) Newer versions have a
React.Fragment
element which is used in place of the polyfill
The "compat" versions of preact and inferno seem to support 1-3. They don't appear to support React Fragments at all yet, but it looks like you should be able to use this polyfill just fine! Let me know if you experience any issues there.
@benwiley4000
Thank for your quick answer.
And sorry for delay, currently problems drop from every side...
Interesting, in that case I agree it should work.
Going to close this for now. Can re-open if we see this doesn't work.