You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<div>you & me </div> // 直接写在元素里的不会转义 ,输出you & me
var str = 'you & me' // 输出 you & me
<div>{str} </div> //当做变量传进来的会转义
// 避免转义的方法:
1. 用一个数组 <div> {['first', <span>&</span>, 'second']} </div>
2. <divdangerouslySetInnerHTML={{__html: 'Mike & Shawn'}} />
The text was updated successfully, but these errors were encountered:
JSX in Depth
本文为我读《ReactJS by Example》英文书第二章的总结
<App />
还是<App></App>
{this.props.children}
的用法:{this.props.children}
可以把一个元素包装成另一个元素而不改变其功能。比如,原来的元素是
className
<table style={{backgroundColor:'#fff',}}>
<table className = 'recentChangesTable'>
data-
除外。The text was updated successfully, but these errors were encountered: