0


React尝试案例一

React尝试案例二

<!DOCTYPE html><html><head><meta charset="UTF-8"/><title>Hello React!</title>

ReactDOM.render(<h1>Hello, world!</h1>,// JSX
    document.getElementById('example'));// JSX
const element0 =<h2>hello, react.</h2>
ReactDOM.render(
    element0, 
    document.getElementById("mine"))

const name ="huyuxuan"
const element1 =<h2>by,{name}</h2>// render

ReactDOM.render(
    element1,
    document.getElementById("mine0"))</script></head><body><div id="example"></div><div id="mine"></div><div id="mine0"></div></body></html><!-- 

function formatName(user){return user.firstName +' '+ user.lastName;}
  
  const user ={
    firstName:'Harper',
    lastName:'Perez'};
  
  const element =(<h1>
      Hello,{formatName(user)}!
    </h1>);
  
  ReactDOM.render(
    element,
    document.getElementById('root'));-->

本文转载自: https://blog.csdn.net/m0_54218263/article/details/122889031
版权归原作者 hhh江月 所有, 如有侵权,请联系我们删除。

“React尝试案例一”的评论:

还没有评论