gaearon / gaearon/react-hot-loader
hot:parent component can not get the instance of its child
- Dominant language
- JavaScript
- Stars
- 12.2k
- Forks
- 775
- PR merge metrics
- No merged PRs in 30d
Description
I want to get this.testRef.current, but parent.js can not get 'this' of child.js.
Thanks for help.
parent.js:
```
import React, { Component } from 'react';
import { Button } from 'antd'
import Test from './Child';
export default class EditPage extends Component {
constructor(props) {
super(props)
this.testRef=React.createRef();
}
render(){
return (
console.log(this.testRef.current)}>click me
)
}
}
```
child.js
```
import React, { Component } from 'react';
import { hot } from 'react-hot-loader/root';
class Child extends Component {
constructor(props) {
super(props);
this.ref = React.createRef();
}
render() {
return (
please input
)
}
}
export default hot(Child);
```
Contributor guide
Assessment
This issue has not been assessed yet.