JavaScript/react/React.RefObject:修订间差异
来自康健生活
创建页面,内容为“== 引言 == == error == * https://stackoverflow.com/questions/64524095/to-create-and-send-react-refobject-as-prop” |
|||
| 第1行: | 第1行: | ||
== 引言 == | == 引言 == | ||
== 示例 == | |||
=== 示例一 === | |||
<syntaxhighlight lang="javascript"> | |||
... | |||
dateWrap: React.RefObject<HTMLDivElement>; | |||
constructor(props: DateProps){ | |||
super(props) | |||
this.dateWrap= React.createRef(); | |||
this.state = { | |||
... | |||
} | |||
} | |||
...</syntaxhighlight> | |||
== error == | == error == | ||
* https://stackoverflow.com/questions/64524095/to-create-and-send-react-refobject-as-prop | * https://stackoverflow.com/questions/64524095/to-create-and-send-react-refobject-as-prop | ||