Having this code in mind:
var Component = React.createClass({ getInitialState: function () { return {position: 0}; }, componentDid
You did syntax declaration error, use proper setTimeout declaration
message:() => { setTimeout(() => {this.setState({opened:false})},3000); return 'Thanks for your time, have a nice day