摘要: 渲染多个组件 function NumberList(props) { const numbers = props.numbers; const listItems = numbers.map((number) => //不写key会看到警告 a key should be provided for 阅读全文
posted @ 2020-12-16 15:59 病阳阳 阅读(77) 评论(0) 推荐(0)
摘要: 逻辑与运算符 && true && expression : 返回expression false && expression :忽略并跳过 三元运算 condition ? true : false 阻止组件渲染 : 给props传入一个bool值 如果为假render方法返回null 而不进行任 阅读全文
posted @ 2020-12-16 14:49 病阳阳 阅读(59) 评论(0) 推荐(0)