前端学习(2216):react元素渲染

index.js

import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';

//<app/>js的普通对象
let app = < App / >
    let root = document.getElementById('root')

    let h1=<h1>helloworld<span>我是</span></h1>
ReactDOM.render(
    h1, root
);

运行结果

©️2020 CSDN 皮肤主题: 成长之路 设计师:Amelia_0503 返回首页