Reactjs 将由文本包围的HTML元素作为props参数传递
我正在使用Reactjs 将由文本包围的HTML元素作为props参数传递,reactjs,react-props,Reactjs,React Props,我正在使用defaultProps MyComponent.defaultProps = { arg1: "hello" arg2: "word" } 我可以像这样传递整个链接标签 arg3: <a id="link" href="https://github.com/myLink">View my portfolio on Github.</a> arg3: 我只希望GitHub这个词是超链接。所以这个论点看起来更像这样: "View my
defaultProps
MyComponent.defaultProps = {
arg1: "hello"
arg2: "word"
}
我可以像这样传递整个链接标签
arg3: <a id="link" href="https://github.com/myLink">View my portfolio on Github.</a>
arg3:
我只希望GitHub这个词是超链接。所以这个论点看起来更像这样:
"View my portfolio on" <a id="link" href="https://github.com/myLink">Github.</a>
“在上查看我的公文包”
传递一个HTML元素,该元素封装了您想要显示的所有内容
<span>View my portfolio on <a id="link" href="https://github.com/myLink">Github.</a></span>
在上查看我的公文包