Questions tagged [reactjs]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
76
votes
4answers
21k 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 ...
47
votes
7answers
6k views

What is the actual value of a consistent code style

I am part of a consultant team implementing a new solution for a customer. I am responsible for the majority of code reviews on the client-side codebase (React and javascript). I have noticed that ...
23
votes
1answer
9k views

Redux memory consumption [closed]

The Redux framework favors immutable state/pure function paradigm, which promotes creation of new state from the previous state in terms of the current action. The applicability of this paradigm is ...
22
votes
4answers
9k views

Why is JSX good, when JSP scriptlets are bad?

React.js provides JSX as an XHTML-like syntax for constructing a tree of components and elements. JSX compiles to Javascript, and instead of providing loops or conditionals in JSX proper, you use ...
12
votes
3answers
5k views

Understanding Flux pattern

I'm actually studying the flux pattern and there's something that I can't understand concerning the stores. What are they exactly? I have read many articles, and it seems that it concerns the ...
8
votes
3answers
9k 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.
8
votes
1answer
1k views

How will React 0.14's Stateless Components offer performance improvements without shouldComponentUpdate?

This question has been going round and round in my head since I read the release notes (and other related hype) around React 0.14 - I'm a big fan of React and I think that stateless components (https:/...
6
votes
2answers
4k 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 ...
4
votes
2answers
908 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 ...
4
votes
2answers
122 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 ...
3
votes
2answers
324 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 ...
3
votes
1answer
154 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 ...
3
votes
3answers
284 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 ...
3
votes
1answer
702 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 ...
3
votes
0answers
74 views

Architecture and Security in a Web/Native app while generating PDFs

I am trying to make a system where a user can view/download his statements (say salary slips). The user will have ability to download PDF versions of these statements and can also save them to Google ...
3
votes
0answers
408 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 ...
3
votes
0answers
349 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 ...
3
votes
0answers
1k 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( ...
3
votes
0answers
288 views

Hot swapping files and metaprogramming with front-end JavaScript

I was inspired by a video on hotswapping JS files with React + Webpack for the web. I started trying it out with React + Backbone + RequireJS. Seems to work, as long as I stick to the stateless parts ...
3
votes
2answers
2k views

Simple React application design

I have a very simple app that lets you log in and then displays a dashboard. The design process with React and Redux is very simple : I have two React components : Login and Dashboard I store a ...
2
votes
1answer
97 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 { ...
2
votes
1answer
604 views

How do functional programming advocates use a framework like React or Angular?

I read this blog post recently: The Two Pillars of JavaScript Part 1: How to Escape the 7th Circle of Hell, which is essentially a criticism of object oriented programming, and advocacy for funtional ...
2
votes
1answer
88 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
52 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, ...
2
votes
1answer
70 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 ...
2
votes
1answer
734 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 ...
2
votes
1answer
133 views

Separating components by “type”?

We have just started to work with React and some of my team mates proposed to split the components in 3 types (each one in its specific folder): components: reusable components like buttons, inputs ...
2
votes
1answer
541 views

Should all the rendered data be stored in redux store?

Assume your app doesn't need to work offline. Also assume that you want to render some fresh data from server -> Redux store for that data is invalidated every time it's rendered. Does it make sense ...
2
votes
2answers
82 views

Isormophic javascript, request processing

I was wondering why isomorphic JS, like using reactjs in both client and server side increase first page load ? What is different from simple SPA applications ? In both cases we are loading the full ...
2
votes
1answer
43 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
142 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 ...
2
votes
1answer
494 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 ...
2
votes
1answer
191 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'...
2
votes
0answers
30 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 ...
2
votes
0answers
57 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: "...
2
votes
0answers
262 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 ...
1
vote
1answer
557 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 ...
1
vote
2answers
551 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 ...
1
vote
1answer
775 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
2answers
895 views

Why are the smart folks who write and adopt react.js okay with the way markup is tightly-coupled/buried inside Javascript?

Quite a while ago there was a concerted trend in the industry to move towards adopting templating to separate markup from logic, or something like that. The result was much more pleasing to the eye ...
1
vote
4answers
275 views

Lead developer wants to use a micro-frontend design pattern. Are my concerns valid?

I'm a React developer at a large company working on an enterprise application which draws on a large amount of data, but performs a very specialized task and has only a handful of internal users. The ...
1
vote
1answer
519 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 ...
1
vote
2answers
553 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 ...
1
vote
1answer
442 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 ...
1
vote
2answers
550 views

How to effectively handle 404/500 http errors in server-side rendering web application which uses store for state?

I'm working on a website using server-side rendering approach. I'm using React and Redux for this. Redux handles the state of the application and provides API to change the state. All asynchronous ...
1
vote
2answers
527 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 ...
1
vote
2answers
984 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-...
1
vote
1answer
698 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 ...
1
vote
3answers
151 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 ...
1
vote
1answer
393 views

(react.js) when is it appropriate to call stores from non-container components

I believe most people are in agreement that using container components is a good practice - described in this popular post: https://medium.com/@learnreact/container-components-c0e67432e005#.qhw8yfodx ...