Skip to content

Instantly share code, notes, and snippets.

@milannankov
Last active February 9, 2018 06:40
Show Gist options
  • Save milannankov/57a8d108d52e04a2f126f300d5eb6f5f to your computer and use it in GitHub Desktop.
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"
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>
);
}
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