React.js: Set innerHTML vs dangerouslySetInnerHTML

后端 未结 4 1178
死守一世寂寞
死守一世寂寞 2020-11-29 15:42

Is there any \"behind the scenes\" difference from setting an element\'s innerHTML vs setting the dangerouslySetInnerHTML property on an element? Assume I\'m properly saniti

4条回答
  •  醉话见心
    2020-11-29 16:43

    Based on (dangerouslySetInnerHTML).

    It's a prop that does exactly what you want. However they name it to convey that it should be use with caution

提交回复
热议问题