Questions tagged [react]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
76 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> &...
-4
votes
0answers
30 views

Proper recursive rendering in React

I'm trying to render a recursive list from a json file. Could you please suggest a proper way to render children (and their children etc.)? Those elements are stored in entry.children By now I can ...
-1
votes
2answers
70 views

How to design front-end to handle multiple back-end versions

In my company, we're using Spring Boot to implement backend API and React to implement frontend including Web interface and Android/iOS apps. Since our product is an Enterprise software, customers ...
1
vote
1answer
56 views

Building a form based on json object?

I'm currently refactoring an older legacy application and use React to rebuild some of the former functionality. This application has a form which has +10 different input fields. The aim is to kind of ...
1
vote
0answers
42 views

Does the React (and Vue.js) frameworks support extensibility?

Please forgive me if I am mixing up the terminology here, I'm a bit unfamiliar with it. I wanted to find a way to support extensibility in a web application; I wanted a web application that was ...
3
votes
3answers
317 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 ...
-4
votes
1answer
83 views

Use React to parse a file (serverless)

I have a design question and am hoping for some validation. I want to create a 'serverless' web app which will parse a csv file and return an XML file. I will have a single page react app hosted in ...
1
vote
1answer
54 views

Using Django Sessions when views are accessed by API

I'm making an app which is a Django backend and a React frontend (being developed by someone else). The plan currently is to fully decouple the two and have them communicate over API. However, I would ...
-4
votes
2answers
67 views

Confused about AWS dev: How to use React with Python in my lambda functions?

I'm very new to the serverless and backend world. I've been looking at tutorials on youtube and on serverless-stack.com (which is really good btw) and they mostly seem to cover React frontend ...
2
votes
0answers
746 views

Updating nested state with React Hooks and Typescript - performance vs clarity

I have some deeply nested react components. Let's limit them to 3 levels of nesting and call them Parent, Children and Grandchildren. The state for the entire app is stored in a single object in the ...
2
votes
0answers
25 views

How authorize web application and manage sessions

i am building a single page react app that uses redux as state manager and an express node js as backend server but i don't know what is the best way to authorize my users in the application! if it ...
-4
votes
1answer
47 views

Why isn't React recognizing the CSS file I've linked in Index.html?

I've built a meme generator using React as an early project to master the basics. I have 6 files in my "mememaker" folder on my desktop, which I created using "create-react-app". They include: index....
2
votes
1answer
46 views

Render constant props components from an object or by hand?

Lets say I have a component that render some "static" information and another one that is the parent of these components. function Foo(){ ... return ( <Bar name="I" {......
-2
votes
1answer
49 views

What does app class means? [closed]

In framworks for developing app whether it be a joomla or react or angular i see app class. What does it mean. Like if there is some user class, or some input class or that make sense for some purpose ...
-3
votes
1answer
65 views

How to configure a React app for different environments

We're configuring the build and release pipeline for our frontend code which is built with React. The final output is just some static HTML/Javascript code. The differences between environments are ...
1
vote
0answers
73 views

Is there a standard convention for onChange handlers for react components?

It seems that some components like to pass an event as the first (or only) argument for a change event, eg (the native input, Material-UI's TextField) and then the programmer accesses the value with ...
2
votes
1answer
602 views

Form validation code shared in the frontend and backend API?

I have a legacy Java monolithic web application. My goal is to use React on the frontend, keep Java on the backend and add an API for the frontend to use. My question is how can I write the data ...
2
votes
1answer
56 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, ...
1
vote
0answers
25 views

Render GUI from React component functions

I'm not sure if this is the right way to build React components. I have a component with several buttons that call different functions in the component. In some of the functions I need to display ...
3
votes
1answer
729 views

Domain classes in DDD structure in React apps?

I'm building an Electron app using React. I'm coming from the C# and WPF world and I'm wondering, where should my domain classes go? I understand the concept of components, but what about a class with ...
0
votes
0answers
57 views

React CRUD patterns

My strategy with react forms has always been (psuedocode): CreateFoo - simply hooks up redux actions to save new record - onOk = (draft) => dispatch(addFoo(draft)); - return <FooForm onOk={...
0
votes
0answers
52 views

Ist good practice adding Converter Between api and client

I just want to curious about adding a converter is a good practice or not. I have multiple API and I always convert API return fields to my client fields. Like=> function ConvertFromAPI(apidata){ ...
-1
votes
1answer
119 views

Why is it called a functional component?

A quick google search shows that the question I have has not been asked directly, and so I ask it here. For what its worth, I am learning react, and I come from a C++ background, where as far as I ...
0
votes
0answers
114 views

Optimizing web dashboard with editable elements for performance by introducing ElasticSearch

To improve performance, we are optimizing our complex tabular web-based dashboard that loads a lot of data (many columns and rows). Many cells in the table are editable so the data is mutable. Our ...
2
votes
0answers
61 views

Where to store the state of a complex form in React?

Let us consider a complex form of registering a driver and owner. The driver will have all these fields: driver = { firstName: "xyz", lastName: "abc", phone: "1234", email: "m@g.com, licence: "...
0
votes
0answers
193 views

How to handle server side pagination + processing large sets of data

So lets say I have a SQL query made by a server that fetches up to thousands of records at a time and I need to display those records in a grid(similar to AG Grid) on the client for the user to review....
0
votes
1answer
475 views

“Fetch the data if it doesn't exist” selector?

Let's say I have a react component like this: const MyComponent = ({data}) => (<div>{JSON.stringify(data)}</div>); const myReduxSelector = (state, id) => state.someData[id]; ...
4
votes
0answers
327 views

How should a non-React component subscribe and respond to Redux state changes?

I’m new to React/Redux tools and still figuring out some idiomatic design patterns. Here's a scenario: A user adding a place marker 📍 (that has some associated metadata) to an interactive map (...
0
votes
0answers
24 views

How can I manage the state of my application using a dedicated object instead of what React offers?

Most of the react application I've seen are organized with components that, in my opinion, do too much. They may follow this pattern: class MyComponent extends Component { constructor() { ...
0
votes
2answers
75 views

Should / When to create javascript object to serialize data?

I'm working on a React/Redux application. I receive a data object from the api resembling this: const dataObj = [ { id: 1, name: "Filo", activity: 9, info: { statusCode: 4 ...
3
votes
1answer
1k views

React: Redux vs Singleton service [closed]

An application I'm currently working on in our front end we currently use React, Redux and some singleton services (wrappers around some 3rd party libraries). We started discussing a new feature which ...
0
votes
2answers
133 views

React and redux app-wide translation best practices

My team and I want to translate an entire React-redux app into another language (english to arabic) and have a switch that does the app-wide translation via a redux action. The content for the first ...
-1
votes
1answer
163 views

How can I prevent my API from being accessed by anything but my website?

I've got an API (Java + Play Framework). I've got a website (React) who has to communicate with the API. I don't want my API being called by anything but my website. How can I do?
-2
votes
1answer
569 views

Cross-domain reactjs component

Lets say I have some react components on domain-a.com. From domain-b.com, an applications calls an API endpoint on domain-a.com. This end point returns the .js of the above mentioned react ...
1
vote
1answer
79 views

How to make a secure web-app account system?

i have some experience (mostly as a student) with react and redux, and on the other hand i also have some experience with express, normally for my apps (all of them are really simple) i make a rest ...
-1
votes
1answer
1k views

Why was Google Maps built using canvas? If it was built today, would it have rather used react/angular? Why (not)? [closed]

Google Maps' frontend is almost completely dependent on canvas. Given that it was initially developed a long time ago, is it still the best approach to take to build such a UI? If not, what is and ...
0
votes
3answers
3k views

How can I handle slow loading of images in react?

I have the following problem. I have a react application that needs to load a grid of individual small, fixed size images, up to a few hundreds (think a 20x20 grid where each cell is a 100x100 image). ...
7
votes
2answers
11k views

Is it antipattern to use React.cloneElement to extend an element?

I'm creating a popover component for a UI in React. That component contains a button that triggers the popover to display. Because the button needs to be configurable--label, classes, properties--I ...
2
votes
1answer
115 views

Why JS MVC frameworks prefer data binding to UI element reference?

When you are using frameworks like Angular, Angular2+, and React, the way you put data in the UI is by binding a property to an attribute of a UI element. On the other hand, when you're doing ...
-2
votes
1answer
59 views

Single Page Apps: handling state dependencies

If I have an React/Redux single page application that has - say - a customers page that lists businesses that are customers, and from there each customer can be accessed with a URL like this: /...
0
votes
2answers
75 views

How should I store a list of file names for a webapp?

I want to be able to call on a list of files that are being processed by the server. The problem is, I want to call them on a web app (think React) whenever a user does something. i.e. a list of all ...
1
vote
2answers
170 views

Is it appropriate to rely on the fact that state doesn't exist for other users coming to the same address?

I am writing a web app. I want users to be able to go to a URL and start a new "session" of my app. They can Slack their friends/colleagues the URL and then everybody is in a socket-connected scenario ...
0
votes
1answer
72 views

Thinking about a setup to work with react and front end development

On my team I'm working as a frontend developer in a React codebase. We're building an application and do everything in React. Before this I was actually always a backend developer. Now I have the ...
2
votes
1answer
283 views

react-redux (React bindings) vs Virtual Dom and Single responsibility principle

I understand React and Redux (at least think that I do). But the combination using the react-redux Binding package is a bit confusing to me. https://github.com/reactjs/react-redux The first thing ...
8
votes
3answers
11k views

React Native - Is using a singleton the best alternative to DI?

I've been reading a lot about the singleton pattern and how it's "bad" because it makes the classes using it hard to test so it should be avoided. I've read some articles explaining how the singleton ...
1
vote
1answer
92 views

Styling shareable React component?

I've been looking for a good way to style a react component just using css stylesheets. I would have used style-loader, because it's as easy as require('./style.css') and allows to save the final ...
1
vote
2answers
338 views

React / GraphQL / Redux design question: Looking for a good practice

A React website I am building is going to have these sections: Hero, Projects, Courses, Skills and a few others. The Skill section will iterate though a list of skills and display a React component ...
0
votes
1answer
45 views

How to know which call is correct when multiple potential calls to API each new one invalidates the old one

I have a react element that will potentially call an API multiple times in a short amount of time. Every new call would invalidate the old one as it is a pricing request to the server. Is there a way ...
0
votes
1answer
610 views

Functional model vs data model and react/redux

I have a module object, that consists of several parameters and an algorithm. A parameter consists of a min, max, step, label and value. The module's algorithm is regularly making a calculation ...
532
votes
6answers
195k views

Pros and Cons of Facebook's React vs. Web Components (Polymer)

What are the main benefits of Facebook's React over the upcoming Web Components spec and vice versa (or perhaps a more apples-to-apples comparison would be to Google's Polymer library)? According to ...