Answers for "create react element with string"

0

create react element with string

mport React from 'react'

const MyComponent = 'div'

function App() {
  return (
    <div>
      <h1>Hello</h1>
      <hr />
      <MyComponent>
        <h3>I am inside a {'<div />'} element</h3>
      </MyComponent>
    </div>
  )
}
Posted by: Guest on November-25-2020

Code answers related to "create react element with string"

Code answers related to "Javascript"

Browse Popular Code Answers by Language