Clone this repository and cd into root project and type npm start
to run the server.
Open http://localhost:3000 to view it in the browser.
A simple CRUD demonstration using pure react.js with a blog on Medium.
Home Page: https://medium.com/@zafarsaleem/crud-using-react-41d047224e26
Clone this repository and cd into root project and type npm start
to run the server.
Open http://localhost:3000 to view it in the browser.
Hi again-
In the render method of the Todo component, the line
<button onClick={this.onCompleteHandle}>Complete</button>
won't work as written. Without a .bind, the method can't update {this.state} and there's no reference to which entry is supposed to be marked complete.
So onCompleteHandle needs to have a .bind and to also be supplied item.id as an argument, as below:
<button onClick={this.onCompleteHandle.bind(this, item.id)}>Complete</button>
Hi Zafar-
Thanks so much for writing this tutorial...it was very helpful. The syntax of your callback methods seems a bit strange in a few places. (If you deliberately did it this way for some reason, please forgive me.)
this.setState({ mockData: this.state.mockData.filter(item => { if (item.id !== id) { return item; } }) }); }
It would be much clearer to write
this.setState({ mockData: this.state.mockData.filter(item => { return item.id !== id; }) });
this.setState({ mockData: this.state.mockData.map(item => { if (item.id === this.state.id) { item['title'] = event.target.updatedItem.value; return item; } return item; }) });
--where, again, it's not really necessary:
this.setState({ mockData: this.state.mockData.map(item => { if (item.id === this.state.id) { item.title = e.target.updatedItem.value; } return item; }) });
I realize these are minor issues but they threw me for a bit of a loop when I was doing the tutorial.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.