Cuong Ta Cuong Ta - 1 year ago 196
React JSX Question

React - Deal with HTML inner of a component tag

I have a code to run app like this:

import React from 'react'
import { render } from 'react-dom'
import AComponent from './components/AComponent'

<span id="needShow">HTML inner Component Tag</span>

And this is component code:

import React from 'react'
const AComponent = () => (
<span> Hello of AComponent</span>

export default AComponent

How can I show span_id=needShow? I search Google but don't see necessary information

Answer Source

Child components are passed to a component via the children prop:

const AComponent = (props) => (
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download