Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [react]

The tag has no usage guidance.

0
votes
0answers
9 views

React Hooks and observables/Rx.js for writing a production ready ReactRX app

I've been learning about observables and how they come up with different flow of writing apps. My goal is to find the best fit for writing React app. I'm experienced React dev familiar with Redux ...
-2
votes
0answers
9 views

Pattern for unsubscribing from RxJS subscriptions

I was reading Ben Lesh's article here: https://medium.com/@benlesh/rxjs-dont-unsubscribe-6753ed4fda87 I am wondering - is the following pattern sufficient? https://gist.github.com/ORESoftware/...
0
votes
1answer
33 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 ...
0
votes
0answers
22 views

React (redux) reusable verification logic

I need to implement a logic which controls weather different components are enabled or disabled depending on a date and a configuration value. The date is selected by the user and the the ...
0
votes
0answers
57 views

React: Redux vs Singleton service

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
41 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
130 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
93 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 ...
0
votes
0answers
25 views

Is it ok to pass non-state objects as props, if DOM updates aren't required?

See my example codepen here: https://codepen.io/kiwideejay/pen/ELRrZN Be sure to open the console. In the example we can see that we can change state.testObj.foo using setState on one button, or ...
1
vote
1answer
73 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
327 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
393 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). ...
1
vote
2answers
3k 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
89 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 ...
0
votes
0answers
53 views

Should a parent container handle the state of all child components even if they are forms?

We've been having this conversation today, the thing is that I have a GenericModal component create that looks kind of like this when you invoke it: <GenericModal child="{ComponentToRender} ...
-2
votes
1answer
55 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
65 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 ...
2
votes
2answers
161 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
57 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
189 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
6k 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
78 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
272 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
464 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 ...