You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a React component that does a similar or even the same thing like preact-markup? Or is it possible to use preact-markup with React somehow? I don't want to fully switch to Preact right now, so this is not an option.
This library had originally been designed to work with either Preact or React, but the use of render arguments makes it Preact-specific. I'd be open to a PR to fix that. If fixed, you'd be able to do this
importReactfrom'react'importReactDOMfrom'react-dom'importMarkupfrom'preact-markup'// tell Markup to use React VDOM elementsMarkup.setReviver(React.createElement)ReactDOM.render(<Markupmarkup="<strong>hello</strong>"/>,document.body)
I was looking into this as well. And one thing I ran into is the difference between h() and React.createElement(); Preact exposes a nodeName attribute and React exposes a type.
Activity
developit commentedon Jan 16, 2017
This library had originally been designed to work with either Preact or React, but the use of render arguments makes it Preact-specific. I'd be open to a PR to fix that. If fixed, you'd be able to do this
jschlieber commentedon Jan 17, 2017
Thanks, will open a PR when I have time.
robinvdvleuten commentedon Aug 3, 2018
I was looking into this as well. And one thing I ran into is the difference between
h()andReact.createElement(); Preact exposes anodeNameattribute and React exposes atype.robinvdvleuten commentedon Aug 3, 2018
And React's type is read-only 😅