create react element with string

Solutions on MaxInterview for create react element with string by the best coders in the world

showing results for - "create react element with string"
Antonio
22 Feb 2017
1mport React from 'react'
2
3const MyComponent = 'div'
4
5function App() {
6  return (
7    <div>
8      <h1>Hello</h1>
9      <hr />
10      <MyComponent>
11        <h3>I am inside a {'<div />'} element</h3>
12      </MyComponent>
13    </div>
14  )
15}