Skip to main content

All Questions

Tagged with
1 vote
3 answers
2k views

Best strategy to push client-side updates to server?

I'm just starting to build a web app using React.js, Next.js, Prisma, & PostgreSQL. In this web app, users can create "projects", which are represented by 10-15 rows in the database. ...
BurstWizard's user avatar
-1 votes
1 answer
106 views

"Select All" in Table is now sending too much data to Server via API - Alternative Ways to Send to Server?

Outline of the current architecture of our web app outlining the issue I'm seeing Client-side app is React, talking to a server running the Play! framework via an API. On the page is a table that ...
bluedevil2k's user avatar
0 votes
0 answers
107 views

Effective cache solution to have the newest data in React Native

Goal We have an app with different articles. I want to cache an article when the user has read it, but make sure that I display the latest data. I came up with this hook: React.useEffect(() => { ...
Gh05d's user avatar
  • 101
0 votes
1 answer
82 views

NextJs Explanation on Ecommerce and Other Project Implementation [closed]

I'm attempting to create a project to increase and enhance my coding skills, and I've lately migrated React to Nextjs. I've noticed that NextJs' main point or strength is rendering; Could someone ...
Mohammad Khan's user avatar
-2 votes
1 answer
154 views

Should I repeat my code or use if statement?

A question from a friend: I have multiple usages for the same code, let's say a vertical HTML card. I change the title and a lot of data based on the react component. it feels unnecessary performance-...
Tailer's user avatar
  • 121
-3 votes
1 answer
383 views

Testing a React component which receives a function as a prop

Suppose there's a root <App /> which houses multiple components, one of them being, say <SearchBox />. App component houses the app state (such as searchResults array) and iterates the ...
McDerp's user avatar
  • 75
0 votes
3 answers
938 views

React - When is a backend necessary?

So I'm currently playing around with web development as a project, and I've been looking at React recently. My current issue is that I'm having trouble distinguishing between front and back end ...
B.Iguana's user avatar
2 votes
2 answers
773 views

React says refs and imperative code are not the right tool for showing and hiding dialogs. Why though?

The docs explicitly state this: Avoid using refs for anything that can be done declaratively. For example, instead of exposing open() and close() methods on a Dialog component, pass an isOpen prop to ...
Silly Freak's user avatar
-2 votes
1 answer
73 views

React class or function for stateful components?

Which is better to use? react class based stateful component or react hooks functional stateful component? I've searched a bit but couldn't find what is preferred to use.
Soul Burn's user avatar
  • 101
5 votes
3 answers
609 views

How to manage chaotic code explosion in React application

So we decided to redo UI of our web application in React. Six months down the lane and we have a complete mess of components and reducers and thunks and actions and god knows what not. We have ...
lahory's user avatar
  • 315
2 votes
0 answers
250 views

React Hooks: using state in useEffect without depending on it

I have run into a situation in React where I want to run a function F in a useEffect hook whenever a value V1 from the store changes. F uses another value from the store V2. I only want to run F when ...
Ace's user avatar
  • 617
2 votes
1 answer
105 views

ReactJS - lift state to main container or export a helper?

I'm using ReactJS (React Hooks, specifically) to build an application. Part of that application involves account creation, sign-in, and authentication. I only recently finished the sign-in feature, ...
IceMetalPunk's user avatar
0 votes
1 answer
2k views

Passing javascript function vs use imports in Svelte or React component

I wanted to use some function from javascript module in one of my component. Should I pass it in props when making the component or should I just use Imports in component itself to get the javascript ...
hatellla's user avatar
  • 181
0 votes
0 answers
45 views

Methods for storing data pre-registration in a web app

I have a web app - it's more complicated than a todo list but for simplicity sake let us assume it is a todo list. The user has the choice to sign up and create an account thus allowing them to store ...
William's user avatar
  • 109
0 votes
0 answers
260 views

Handling user permissions in front-end

I'm building an API that will be used by the front-end in React and I'm not quite sure how I should send the permissions of each user based on their roles. Some fields can only be edited in some ...
André's user avatar
  • 137

15 30 50 per page