Last active
February 9, 2018 06:40
-
-
Save milannankov/57a8d108d52e04a2f126f300d5eb6f5f to your computer and use it in GitHub Desktop.
Kendo React Wrappers - Resolving Error "The node to be removed is not a child of this node"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
render() { | |
return ( | |
<div className="app"> | |
<div><button onClick={this.onButtonClicked}>Toggle</button></div> | |
{/* Conditionally show Kendo DropDownList */} | |
{this.state.showList && | |
<div> {/* Wrap the component in a div element */} | |
<DropDownList dataSource={["One", "Two", "Three"]} /> | |
</div> | |
} | |
</div> | |
); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from 'react'; | |
import '@progress/kendo-ui'; | |
import { DropDownList } from '@progress/kendo-dropdowns-react-wrapper'; | |
export interface State { | |
showList: boolean | |
} | |
export interface Props { | |
} | |
export class App extends React.Component<Props, State> { | |
constructor(props: Props) { | |
super(props); | |
this.state = { | |
showList: true | |
} | |
} | |
render() { | |
return ( | |
<div className="app"> | |
<div><button onClick={this.onButtonClicked}>Toggle</button></div> | |
{/* Conditionally show Kendo DropDownList */} | |
{this.state.showList && <DropDownList dataSource={["One", "Two", "Three"]} />} | |
</div> | |
); | |
} | |
private onButtonClicked = (event) => { | |
this.setState({ | |
showList: !this.state.showList | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment