Debug School

rakesh kumar
rakesh kumar

Posted on

How to display data after retrive data from database in react js

Step 1:Define function inside while loading data

Image description

step2: mention routing in a function and dispatch to reducer.js
Image description

Image description
step3: mention routing in a server side

Image description

step5: apply query in controller

Image description

step6: renders data in react js
Image description

Image description

OUTPUT

Image description

==========================================================
Renders single data in react js

Step 1:Define function inside while loading data
Image description

Step 2: get user data from local staorage
Image description

step3: mention routing in a function and dispatch to reducer.js
Image description

Image description

step4: mention routing in a server side
Image description

step5: apply query in controller
Image description

Image description
======================OR=================

const { project, task, userId } = req.query;

const data = await YourModel.findOne({ userId: userId });
Enter fullscreen mode Exit fullscreen mode

step6: Renders data to display

Image description

Top comments (0)