반응액세스 심판은 내가 첫 번째 구성 요소가 나타납니다 두 형제의 구성 요소를,이 경우 다음과 같이 내가이 상황을
import X from './x'
export class Y extends Component {
render(){
return (
<div>
<div>
//Here I want to render the div inside //component X
// In the real case, I show the div here in //response to a button click event.
//I have tried to import the component and get //the refs of X, but that is not working.
</div>
</div>
)
}
}
구성 요소 X를 Y로 가져 와서 X의 참조를 가져 오려고했으나 작동하지 않습니다 (참조 개체는 항상 null입니다). 내가 이것을 성취 할 수있는 다른 방법이 있습니까?