[SOLVED]-NEW DATE().GETFULLYEAR() IN REACT-REACTJS
NEW DATE().GETFULLYEAR() IN REACT-REACTJS
Uou need to put the pure javascript inside {}
. this works for me:
class hellomessage extends react.component {
render() {
return <div>{(new date().getfullyear())}</div>;
}
}
reactdom.render(<hellomessage />, mountnode);
the compiled version is:
class hellomessage extends react.component {
render() {
return react.createelement(
"div",
null,
new date().getfullyear()
);
}
}
reactdom.render(react.createelement(hellomessage, null), mountnode);