This gives an error: This is normal text. how to solve this problem in react its file of layout im using visual studio So is this, but now follows a code block:
export default class Layout extends React.Component {
constructor(props) {
super(props);
this.identify = this.identify.bind(this);
}
identify() {
if (this.props.dashboard) {
return (
<div>
<Header />
<Container>{this.props.children}</Container>
<Footer />
</div>
);
} else {
return (
<div className="flexible-content">
<TopNavigation />
<SideNavigation />
<main id="content" className="p-5">
{this.props.children}
</main>
<DashFooter />
</div>
);
}
}
render() {
return { this: this.identify };
}
}
You just need to call identify
method which returns JSX in your case
render() {
return this.identify();
}
You need to return valid JSX from the render function. Right now you're returning an object of { this: this.identify }. You just need to return this.identify()
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.