这是一道题
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<div id="app" style="display: none"></div>
<!--//react怎么通过组件修改这个div的样式,比如修改他的display,不能操作dom-->
</body>
</html>
下面是js
import React from 'react'
import {render} from 'react-dom'
class Application extends React.Component {
render(){
return (
this.props.children
)
}
}
//下面不能修改
render(<Application><a>123</a></Application>, document.getElementById('app'));