want to embed a plug-in in modal, but you need to get the dom node tag. How to get the
ref and ReactDOM.findDOMNode methods have been tried, and the result is null
parent component:
< AddUserWin ref= "AddUserWin" visible= {state.visible} title= {state.title} hideModal= {me.hideModal} record= {state.record}
canEdit= {state.canEdit} / >
Sub-component modal module:
< Modal title= {props.title} visible= {props.visible} onCancel= {this.handleCancel} width= "900" footer= {modalBtns} >
<Form horizontal form={this.props.form}>
<FormItem>
<div ref={(ref) => this._div = ref}></div>
//
<div ref="edit"></div>
</FormItem>
</Form>
</Modal>
I use
var editor = ReactDOM.findDOMNode (this._div) or this.refs.edit
in the componentDidMount of the child component, the componentDidMount of the parent component and the modal method of the parent component. I have tried to get it when written outside modal. The code is as follows:
<Modal title={props.title} visible={props.visible} onCancel={this.handleCancel} width="900" footer={modalBtns} >
<Form horizontal form={this.props.form}>
<FormItem>
</FormItem>
</Form>
</Modal>
<div ref={(ref) => this._div = ref}></div>
</div>
at this time, ref"s div can be obtained, but what I need is really inside modal. I would like to ask the boss what method
look forward to getting dom tag elements. What I actually get is null
PS: stuck in the progress of the project. I am very urgent at present. I hope to get your help. If you can solve the problem, please have a cup of coffee. Thank you!