What is the proper way to get data from database in react?

What is the proper way to get data from database in react?

I have some simple react app with authorisation, which is done with - jwh tokens and Redux magic code, that I cannot understand to the point (and hope not to touch that technology if that is ever possible - really dislike it, too obfuscated and complex-to-write style for novice). But that's lyrics away.

I have some simple react app with authorisation, which is done with - jwh tokens and Redux magic code, that I cannot understand to the point (and hope not to touch that technology if that is ever possible - really dislike it, too obfuscated and complex-to-write style for novice). But that's lyrics away.

So after login some token is saved somewhere, some magic happened, and this have two consequences: now I have my user.id in props.user, and may call api endpoints with axios, (normally unavailble without auth).

Now I have user login history table, and I want to display a data table associated with user on a page. Where should I fetch the database? Simpliest way I found up to date is to poll backend api (to poll mongoDb) in componentWillMount() method. Then I could have access to the data in render(), to display user table. Is that correct? Or am I forced to somehow "sync state" with a Redux? Or what? I am lost in paradigms..


PS. Polling that works, but if data is updated dynamically by another user I cannot see updates about that he was logged in (without refreshing page).

node-js reactjs mongodb express redux

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Ecommerce MERN(MongoDB Express.js React.js Node.js) Redux Tailwind

Ecommerce MERN(MongoDB Express.js React.js Node.js) Redux Tailwind

Node.js Express MongoDB Tutorial

Node.js Express MongoDB Tutorial is CRUD example, I have created to showcase Express web framework, MongoDB NoSQL database, and Node.js server platform.

How to Use Express.js, Node.js and MongoDB.js

In this post, I will show you how to use Express.js, Node.js and MongoDB.js. We will be creating a very simple Node application, that will allow users to input data that they want to store in a MongoDB database. It will also show all items that have been entered into the database.

Build a REST API using Node.js, Express.js, Mongoose.js and MongoDB

Node.js, Express.js, Mongoose.js, and MongoDB is a great combination for building easy and fast REST API. You will see how fast that combination than other existing frameworks because of Node.js is a packaged compilation of Google’s V8 JavaScript engine and it works on non-blocking and event-driven I/O. Express.js is a Javascript web server that has a complete function of web development including REST API.

Node.js MongoDB Tutorial | Writing CRUD App with NodeJs, Express and MongoDB

Welcome to this course on Node.js Rest Api with Express & MongoDB . In this video we will Get Started with ExpressJS. In software development. Ii this Node.js MongoDB Tutorial, you'll see writing CRUD App with NodeJs, Express and MongoDB