既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上大数据知识点,真正体系化!
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新
bbb: null,
ccc: true
}
}
render() {
const { aaa, bbb, ccc } = this.state
return (
<div>
{/\* null、undefined、Boolean类型显式内容为空,被忽略 \*/}
<h2>{aaa}</h2>
<h2>{bbb}</h2>
<h2>{ccc}</h2>
{/\* 如果希望显式需要转为字符串类型 \*/}
<h2>{aaa + ""}</h2>
<h2>{String(bbb)}</h2>
<h2>{ccc.toString()}</h2>
</div>
)
}
}
const app = ReactDOM.createRoot(document.querySelector(“#app”))
app.render()
>
> 情况三:Object对象类型不能作为子元素(报错: not valid as a React child)
>
>
> * 注意: 并不是花括号中不能写对象类型, 是对象类型不能作为子元素
>
>
>
class App extends React.Component {
constructor() {
super()
this.state = {
student: {
name: "chenyq",
age: 18
}
}
}
render() {
const { student } = this.state
return (
<div>
{/\* Object对象类型不能作为子元素, 会报错 \*/}
<h2>{student}</h2>
</div>
)
}
}
const app = ReactDOM.createRoot(document.querySelector(“#app”))
app.render()
>
> 情况四: JSX中嵌入表达式
>
>
> * 运算表达式
> * 三元运算符
> * 插入一个函数调用
>
>
>
class App extends React.Component {
constructor() {
super()
this.state = {
firstName: "chen",
lastName: "yq",
age: 20,
movies: ["黑话律师", "大话西游", "独行月球"]
}
}
render() {
const { firstName, lastName, age } = this.state
return (
<div>
{/\* 4.可以插入相应的表达式 \*/}
{/\* 运算表达式 \*/}
<h2>{20 + 30}</h2>
<h2>{firstName + " " + lastName}</h2>
{/\* 三元运算符 \*/}
<h2>{age >= 18 ? "成年人" : "未成年"}</h2>
{/\* 调用一个函数 \*/}
<ul>
{this.getMoviesItem()}
</ul>
</div>
)
}
getMoviesItem() {
const liEls = this.state.movies.map(item =>
- {item}
- )
return liEls
}
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上大数据知识点,真正体系化!
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新