Skip to content

[Question] Markup component for React? #9

Open

Description

@jschlieber

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.

Thanks in advance!

Activity

  1. developit commented on Jan 16, 2017

    @developit
    Owner

    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

    import React from 'react'
    import ReactDOM from 'react-dom'
    import Markup from 'preact-markup'
    
    // tell Markup to use React VDOM elements
    Markup.setReviver(React.createElement)
    
    ReactDOM.render(
      <Markup markup="<strong>hello</strong>" />,
      document.body
    )
  2. jschlieber commented on Jan 17, 2017

    @jschlieber
    Author

    Thanks, will open a PR when I have time.

  3. robinvdvleuten commented on Aug 3, 2018

    @robinvdvleuten

    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.

  4. robinvdvleuten commented on Aug 3, 2018

    @robinvdvleuten

    And React's type is read-only 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions