javascript - React is not rendering in webpage? (w/Handlebars) -
i trying implement react small piece of website, reason not rendering ever. using node, express, react, , handlebars.
landing.handlebars:
<section class="section section-dark"> <div id="root"></div> <script type="text/jsx" src="index.js"></script>
index.jsx:
import react 'react'; import reactdom 'react-dom'; import app './app'; reactdom.render(<app />, document.getelementbyid('root'));
app.jsx:
import react, { component } 'react'; class app extends component { constructor(props) { super(props); this.state = { name: null, email: null, message: null, }; this.handlechange = this.handlechange.bind(this); this.handlesubmit = this.handlesubmit.bind(this); } handlechange(event) { const target = event.target; const value = target.value; const name = target.name; this.setstate({ [name]: value }); } handlesubmit(event) { event.preventdefault(); } render() { return ( <div classname="app"> <h2 classname="bottom">send message!</h2> <form onsubmit={this.handlesubmit} classname="bottom"> <div classname="form-group"> <label for="exampleinputemail1">email address:</label> <input type="email" onchange= {this.handlechange} value = {this.state.email} classname="form-control" id="exampleinputemail1" aria-describedby="emailhelp" placeholder="enter email" /> <small id="emailhelp" classname="form-text text-muted">we'll never share email else.</small> </div> <div classnamename="form-group"> <label for="exampleinputpassword1">name:</label> <input type="text" onchange= {this.handlechange} value={this.state.name} classname="form-control" id="exampleinputpassword1" placeholder="name" /> </div> <div classname="form-group"> <label for="exampletextarea">message:</label> <textarea onchange= {this.handlechange} value={this.state.message} classname="form-control" id="exampletextarea" rows="3"></textarea> </div> <button type="submit" value="submit" classname="btn btn-primary"> <i classname="fa fa-paper-plane" aria-hidden="true"></i> send</button> </form> </div> ); } } export default app;
it shows no sort of jsx file in network tag @ besides ones necessary (jquery, bootstrap, etc)
Comments
Post a Comment