Questions tagged [reactjs]
The reactjs tag has no summary.
130 questions
3
votes
2
answers
221
views
Where should I store the access token in React?
I'm building a web app using Spring Boot (backend) and React (frontend).
My authentication is based on JWT, with both access token and refresh token.
The refresh token is stored in an HTTP-only ...
1
vote
0
answers
95
views
Deciding between two design alternatives for displaying series of screens in mobile applications?
I am developing a mobile application, and one of the features is a "story" that is essentially a series of screens. The screens can be of three main templates:
A "video" template ...
1
vote
3
answers
255
views
Does ReactJS Compound Pattern violate the DRY principle?
Let's say we have this component:
const Card = ({ title, description, price, tag, category }) => {
return (
<div>
{title && <h5>{title}</h5>}
{...
-2
votes
1
answer
119
views
Best Practices for Managing State in React Applications
I'm currently developing a web application using React and I'm looking for the best practices for managing state effectively. I've come across several methods such as using the Context API, Redux, and ...
0
votes
1
answer
462
views
Is it a good idea to serve a Single Page Application as a static site?
I've built a small single-page web application in React and seen that it's possible to serve the app as a static site on something like S3.
Previously, I considered using Nginx, but as this is lower ...
1
vote
1
answer
859
views
How could I apply the strategy pattern to a react component? [closed]
For the following component, how would I extract the unit logic to allow for composition? In my actual app I am trying to reduce the amount of logic encoded in the component and I have decided that ...
-1
votes
1
answer
200
views
Best approach to communicate C++/Python and Front-End
I work with Computer Vision applications, mainly in Python and C++. Recently, I get involved with a customer that wants to create a UI based on React JS to visualize the results of our software in ...
-2
votes
1
answer
262
views
Is it OK to stick with object graph in React State and should I make helpers for handling it?
I am trying to build ERP application using React frontend and I have not found decisive answer whether to use object graphs in React state?
E.g. I would like to build Invoice view and I have the ...
-1
votes
1
answer
117
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 ...
4
votes
1
answer
1k
views
Need a deeper understanding of how a Virtual DOM is different from a real DOM
As all articles say the Virtual DOM is lightweight and allows us to update only those nodes that has to be updated, unlike the real DOM that updates the whole nodes structure.
So the first question: ...
0
votes
0
answers
139
views
Identify Domain Entities for a search tool interface - Clean Architecture
I am pretty new to Clean Architecture / Onion Achitecture, I actually not sure if the 2 terms are exchangeable.
So it pretty clear to me, considering is a few days I am reading and study about it.
It ...
4
votes
2
answers
1k
views
What is the Advantage of React JS over Pure Javascript + PHP?
What exactly is the purpose of React JS? I've heard a few things, like:
It updates the page without refreshing.
It is modular and can reduce redundant coding.
It is faster than updating the DOM ...
1
vote
2
answers
3k
views
Preventing parent component re-rendering of a big React component when you "Lift State Up"
I have a very big form - let's call it <MyForm> - consisting of the following:
text fields and dropdowns
custom selector made of selectable cards
table input (for this example 50 rows with each ...
0
votes
1
answer
98
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 ...
0
votes
1
answer
285
views
Where should I put/handle periodic data updates in React?
I'm following the guide in https://reactjs.org/docs/thinking-in-react.html which makes sense for data that I request and update on a filter.
However, I want to have some sort of general ...
1
vote
2
answers
623
views
React: Ternary operator within component vs outside component
I have a pull request and this pr is being reviewed by co-worker.
Context
I'm using React and a specific component has ternary operator within component like below.
const ExampleComponent = (): React....
4
votes
1
answer
2k
views
Authentication with JWT in HTTP only cookie without refresh token
The motto of the upcoming question is "I don't know what I don't know".
I would like to know if there are downsides or security risks with an authentication implementation.
Right now, I'm ...
-3
votes
1
answer
149
views
Sharing React Native Component as a "black box"
I'm looking for a way to share a React Native component with 3rd parties without having to share the actual source code.
Something like a .jar in Java or a .dll for C#.
So assuming we have company A ...
-1
votes
1
answer
193
views
Loading in and Autocompleting a CSV File React
I'm currently working on a React Application with Firebase that involves a ton of data manipulation and reading. One specific feature is the ability to autofill a form based on a very large CSV file (...
-3
votes
1
answer
427
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 ...
1
vote
1
answer
655
views
Is it an anti-pattern on React to search for children with a specific element type?
Context
When designing the API of a React component, you may decide to receive props in a more semantical way. Here's a simple example
<Modal headerTitle="foo" />
vs
<Modal>
&...
0
votes
3
answers
1k
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 ...
1
vote
1
answer
57
views
what kind of relationship do child components have with components in react?
I'm currently writing a paper on my react frontend and I'm struggeling to find the right verb for the interaction between child-components and components in react.
For example:
"I have a table ...
5
votes
1
answer
466
views
ReactJS with Elasticsearch app architecture
I want some advice regarding my architecture and hosting options.
I'm attempting to build an e-commerce site for e-books. It will use NestJS for the backend and ReactJS+Typescript for the frontend.
...
-2
votes
1
answer
85
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.