CRUD #3 Get Create Edit Data in React Js using API

Posted at: February 28, 2019 5:26 PM

CRUD Operation: Get, Add and Edit Records.

In this lesson you can learn how to read, add and edit data in React Js using api with the help of an example. API has created in CodeIgniter and MySQL.

You can see the code explanation about this page on giving YouTube link in the bottom of this page.

Bootstrap also installed in this tutorial. You can learn how to Integrate Bootstrap with React Js

Product Listing

Create src/ProductList.js a file for showing product list.

src/ProductList.js

Add and Edit Product

Create src/AddProduct.js file for add and edit product form and create stateful component AddProduct.

src/AddProduct.js

src/App.js

Import AddProduct from ./AddProduct for add and edit product. And also ProductList component from ./ProductList for showing the proudcts.

src/index.js

API

API has created in CodeIgniter. You can learn CodeIgniter 3 Tutorial Step By Step

Controller

application/controllers/ReactApi.php

Model

application/models/ReactApi_model.php

MySQL Database `products` Table

Conclusion

In this lesson we have learned crud operation, how to add, edit and show product list in React Js using API with the help of an example.

This lesson also available on YouTube
API Fetch POST Request CodeIgniter MySQLCreate GetEdit

Please leave comments

1 Comments