0
我有一個代碼,這樣運行的應用程序:陣營 - 與HTML內應對的成分標籤的
import React from 'react'
import { render } from 'react-dom'
import AComponent from './components/AComponent'
render(
<AComponent>
<span id="needShow">HTML inner Component Tag</span>
</AComponent>,
document.getElementById('root')
)
而這部分代碼:
import React from 'react'
const AComponent =() => (
<div>
<span> Hello of AComponent</span>
</div>
)
export default AComponent
我怎麼能顯示出跨度與ID needShow
?
@AndrewL。你可以,但不經常做,請參閱https://facebook.github.io/react/docs/reusable-components.html#stateless-functions – Nit