Say I have a card containing a registration form
<Card> <LoginForm/> </Card>
How do I access nodes from a form in a map render function?
<Form > <input type="text" name="email"/> <input type="password" name="password"/> <input type="submit"/> </Form>
Because I would like to make submitbutton not in the context of props.children, but to make it wrapped outside this child!
render () { return ( <div className="card"> <div className="inner"> {/* render Children */} {this.props.children != undefined ? <div className="childrenWrapper"> {this.props.children} </div> : "" } </div> {/* render submit from login form here, not above */ </div>)
There are some components that really do what I want. For example, the Tabs component from react-toolbox . They somehow contribute to the fact that inside the Tab (children) somewhere else
Just for example
<Tabs index={this.state.inverseIndex} onChange={this.handleInverseTabChange} inverse> <Tab label='First'><small>First Content</small></Tab> <Tab label='Second'><small>Second Content</small></Tab> <Tab label='Third'><small>Third Content</small></Tab> <Tab label='Disabled' disabled><small>Disabled Content</small></Tab> </Tabs>
Which will result in the following html
As you can see the children from the tab where they are displayed in their own section I donβt want to change anything in the form to solve this problem, I would like to transfer the form to the Map and let the Map decide how the Form will be displayed in the map rendering function.
As I try to implement the Google component Material Design Map and just use it as a template, there are more elements that need to be divided and placed in the positions that I want them to be. The fact is, I could place the corresponding HTML code around the Form to get it as the map I want, but then I will not need the component at all.
source share