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 [reactjs]

The tag has no usage guidance.

0
votes
1answer
52 views

Why are React keys limited to strings?

In React, when rendering a mapping from elements of a list/array/iterable to React elements, we're required to attach a locally-unique key to each element. Generally this is so that if an element ...
2
votes
1answer
34 views

continuous deployment of web application built with multiple packages

Our react web application is broken down to multiple components. Some of these components are part of the same git mono repo and some live in a different repo. Now, to implement a bug fix we have to ...
0
votes
0answers
34 views

Best practise/tidy way for adding google analytics to a React application?

This blog here recommends using react-ga and just adding react events every, eg on event clicks, like: export default class SomeComponent extends React.Component { handleClick() { ...
-4
votes
1answer
26 views

Easiest way to add tracking of interactivity (mouse clicks, scrolls, multi-touch gestures) to a React Web App already developed?

Context: we have a responsive web application developed in React.js, which we have successfully used a few times to run user studies on Amazon Mechanical Turk. Now, we would like to add interactivity ...
0
votes
1answer
44 views

ReactJS - proper way to handle a responsive design approach?

I've always used CSS and media queries when it comes to responsive design. I've been developing in ReactJS for a while, but I feel my approach to responsive design is sloppy. I find myself using a mix ...
2
votes
1answer
84 views

New components that implement an abstract component, vs variants on a single component.

I have created some stateless functional components that represent round social media icons used for links/sharing, the code looks like this: AbstractRound import React from 'react'; import { ...
1
vote
1answer
142 views

How to store blog post in database - React & GraphQL

I am building travel blog using React as frontend Javascript framework along with GraphQL. I am doing this project by myself as a pilot test and I am currently in a phase of translating photoshop ...
1
vote
1answer
65 views

OrderedMap or List for Redux structure?

I'm implementing a Redux store for a React app using redux-saga for API calls. I've used Immutable.js before for other Redux-using React apps but the nature of previous projects always evidently ...
-2
votes
1answer
72 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
39 views

How to reuse the same code for separate desktop/mobile Web Applications?

I see that websites like Instagram and Facebook do not fully make use of RWD but serve separate websites depending on the target viewport. I can see how this might be better than RWD - less CSS, ...
0
votes
0answers
55 views

Do database CRUD operations dictate whether and application should be one-way or two-way binding?

I am confused (easily done). To me model is the data from the database sent back as JSON. When I think of that in an Angular context, when two-way binding is configured, it makes me think the ...
0
votes
1answer
52 views

Does Flux/Redux concept about application state put bounds on the size of application?

In Redux (React Flux implementation) guide https://redux.js.org/basics/reducers it is said, that In Redux, all the application state is stored as a single object My questions are: How seriously ...
-2
votes
1answer
38 views

pixels aside, how to cross the uncanny valley of hybrid apps? (performance)

I see the top drawbacks of hybrid (webview/dom) apps, compared to native, as the following, in order time to startup/launch smooth frame rates (no jank) responsiveness to input, instantaneous are ...
4
votes
2answers
344 views

Benefits of using a JS Framework

I am starting a new project and trying to decide if I should use a Javascript framework (like vue.js or react) and create a Ruby on Rails API, or use Ruby on Rails to server-side render pages and ...
1
vote
0answers
23 views

React JS: Mixing data types for one state property

In the spirit of minimising state I always have a desire to mix data types for a given state property. For instance, if I were creating a React page that rendered a list of items that could either be ...
-1
votes
2answers
118 views

When does it make sense to make an individual React component?

The most obvious criteria for me is for component re-usability, as well as internal state management but aside from that are there are any other good reasons? For instance, I could have a component ...
1
vote
1answer
267 views

How should I structure React Redux components when requesting Data From an API?

I have a search box I'm going to use on different pages (I use the term 'page' loosely here). The search box puts its value (the search string) into the Redux state. The results are populated from an ...
0
votes
0answers
52 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} ...
0
votes
1answer
65 views

What types of operations should go into Node.js as opposed to client side javascript functions

I am building a web app with a lot of different API calls: our own proprietary REST API, third-party library API calls, etc. All of these calls either retrieve data, update data, delete data, or ...
5
votes
1answer
2k views

React: Nested object as state vs individual properties

Are there any use-cases where a nested object as state is either more optimal/easier to work with than individual properties? For instance if I wanted to express some user controls for interacting ...
2
votes
1answer
141 views

Is it bad practice to combine a projects static site with the app?

We are building a react based web app for a project/potential business and I'm wondering if it's ok to include the static site in the web app code? I've always had a separate basic html and css code ...
1
vote
2answers
318 views

Does it make sense to create a whole new API interface to just handle the web secret key?

In OAuth2.0 we have to send client id and secret along side the user credential to obtain an access token from an authorization server. We have a ReactJS web application that needs to send its request ...
3
votes
2answers
96 views

REST: How to deal with relative resources?

I'm designing an web app with React as front-end, and I'm trying to properly understand REST API practices. Reading resources online, one can get the idea that the REST API is seen kind of like an ...
0
votes
0answers
54 views

When does DRY become counter-productive? [duplicate]

I'm working on a project using Reactjs on the front-end and while working on it, I have been focusing on 'thinking in React'. In doing so, I'm building re-usable components and trying to not repeat ...
2
votes
0answers
209 views

Single page React on Rails app vs Multi page React on Rails app [closed]

I've been looking around hoping to get some perspective of the pros and cons of using a Single Page React App vs. a Multi Page React App. The end product of the project is a page with 5 tabs, each ...
0
votes
1answer
126 views

In the react docs why is binding of *this* preferred over arrow functions for event handlers?

In the React docs, the constructor functions of class components contain lines where this is explicitly bound for event handlers e.g. in the docs for handling events class Toggle extends React....
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 ...
1
vote
2answers
605 views

What other approaches are there to break circular dependency in MVC?

I'm attempting to build a web front-end based on the MVC pattern, as opposed to based on the libraries involved (e.g. React.js). I'm using constructor-based dependency injection and interfaces to de-...
0
votes
0answers
49 views

2-way data binding when you store different format from display

I'm using React but I can imagine this concept applying in any 2-way binding situation, where a value is both displayed and stored and these 2 are being kept in sync. Take for example an app which ...
0
votes
1answer
142 views

Redux: When Should I Keep Track of State and When Should I Not?

NOTE: I am new with the whole concept of state management. I never got into the older languages that "explicitly used" states. I dived into React and Redux for the past week, and as I'm getting into ...
1
vote
1answer
431 views

How do you update a client state with a server state in Vue or other reactive frameworks

You have a server that sends the client data. A JSON object. {"name": "folder1", size: "2406"} The client updates it's data: data = newData And the client is updated. Reactive frontend coding as ...
2
votes
0answers
281 views

Fetch data in parent vs fetching data in child

I know that I want to develop a React App like so: <PhotoPage> <FeedFilter/> <PhotoFeed/> </PhotoPage> Without using Redux, I know that I need to fetch a dataset of ...
1
vote
1answer
328 views

What's the system architecture of a non-SPA reactive application?

I'm starting to learn about reactive web applications, and I pretty much get the hang of the whole components, virtual DOM, states and more. First of all, I usually don't name a technology, but for ...
71
votes
4answers
19k views

Why do many software developers violate the open/closed principle?

Why do many software developers violate the open/closed principle by modifying many things like renaming functions which will break the application after upgrading? This question jumps to my head ...
1
vote
2answers
381 views

Does making a react flash message globally accessible break any conventions?

I read this article where it describes making a flash message in a react app: https://medium.com/@veelenga/displaying-rails-flash-messages-with-react-5f82982f241c They mention adding a reference in ...
2
votes
1answer
469 views

Is undo and redo possible/feasible with two-way data binding (vs uni-directional data flow)?

I'm developing an experimental application for work that requires fully persistent undos and redos. I decided to use react/redux/immutable JS tech stack to solve this problem because I saw it worked ...
2
votes
0answers
257 views

React DOM manipulation vs CSS for responsive breakpoints?

Specifically for ReactJS and responsive frameworks that show/hide elements based on width like Bootstrap. Because ReactJS has a virtual DOM I am presuming doing the DOM manipulation is faster and in ...
0
votes
1answer
198 views

Does Angular2 or Angular4 offer an app state and middleware promise like React / Redux?

I used Angular 1 and React / Redux, and one thing I like about React / Redux is that there is a definite app state, and a middleware that can convert a promise into real data. In Angular 1, we often ...
3
votes
1answer
325 views

Is it true that for both React or Angular, they are also both “convention over configuration”?

In the Ruby on Rails communication, it is often said that RoR is "convention over configuration". Can you say for React / Redux / Flux and AngularJS, Angular2, they are also "convention over ...
3
votes
1answer
179 views

Does AngularJS or Angular 2 provide something similar to the Redux middleware so that AJAX data appear immediately available?

I am learning React / Redux, and one feature I like is, when you fire off an Action, you actually provide a request as the "result" or what is called the payload in Redux, and the Redux middleware won'...
1
vote
2answers
402 views

is a react container component an instance of the adapter pattern?

I'm referring to the two types of react components - presentation component and container component. In a more platform-agnostic description, is the container component just an adapter for a ...
2
votes
1answer
623 views

Animations and React — is it bad practice to mix them?

I have been in arguments with programmers that mixing elements with animations and react is very bad practice, and that all animations should be in a style sheet because that is something ...
1
vote
1answer
410 views

Is using both Selenium and Mocha redundant?

I am learning React+Redux now and came to the testing section. Many people use Mocha or Jest to test React components, so far so good, makes sense. I previously have experience using Selenium and I ...
2
votes
0answers
868 views

How to passing variables from php to react.js component?

For example, I have a react.js component named Question which need the props title,id,content. <div id="main-section"> <div id="question"></div> </div> ReactDOM.render( ...
0
votes
1answer
425 views

Is it necessary to use inline JavaScript with React? Would React therefore get blocked by default by Content Security Policies (CSPs)?

According to https://www.quora.com/What-are-the-key-difference-between-ReactNative-and-NativeScript/answer/Valentin-Stoychev , "ReactNative as using the notation found in React for inlining the UI ...
1
vote
3answers
143 views

Is it common/appropriate to have a Flux application that combines Actions and Dispatchers?

I just picked up a React/Flux app and I'm new to the technology stack. One of the things that's throwing me off is that just about every tutorial I view on this stack very clearly defines Dispatchers ...
3
votes
2answers
316 views

How can I improve the relationship between the designer and developers? [closed]

My team is faced with a big challenge. We are building a greenfield app against a legacy codebase. The legacy code contains .NET controls with a certain look and feel. Our front end is ReactJS. We ...
4
votes
3answers
4k views

camelCase, PascalCase, or underscore if you start from scratch with reactjs?

Title says it all. Can't seem to find what is most common out in the world. I'm brand new to programming. If the answer is "it depends", I would love to know what it depends on. Here to learn.
2
votes
0answers
300 views

Dynamic React Application Components - like Django Admin

First, to those who don't know, Django-admin, a decade old applications works as such: You write a class describing the functionality and the expected behaviour of the application: class AuthorAdmin(...
3
votes
1answer
152 views

Would a site like stack overflow be better as separate static builds or a single app with run-time switches for each community?

I'm designing a web application. I'd like to use sub-domains to split the site into logic separate sections based on some category - exactly like the stack exchange websites do. I'm currently aware of ...