Questions tagged [reactjs]
120 questions
80
votes
4 answers
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 after the fast and the continuous versions in the…

Anyname Donotcare
- 1,364
- 2
- 16
- 29
49
votes
7 answers
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 some team members use unique coding patterns to a…

Andreas Warberg
- 454
- 5
- 9
30
votes
5 answers
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 Javascript directly:
-
{list.map((item) =>
…

wrschneider
- 1,259
- 1
- 10
- 9
28
votes
13 answers
Ways to explain code when told it doesn't make sense
As a programmer I have found my code frequently elicits the reaction "I don't understand". Whenever I get this response I try my best to explain my code patiently, and not make anyone feel afraid to ask questions.
I am pretty sure I've got the…

yeerk
- 490
- 4
- 7
24
votes
1 answer
Redux memory consumption
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 indubitable.
A major concern of mine is that, as…

Stephen Isienyi
- 367
- 1
- 2
- 6
12
votes
3 answers
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 domain.
Does it mean that this is the "abstract" part…

mfrachet
- 1,481
- 3
- 15
- 21
11
votes
3 answers
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.

Will
- 123
- 1
- 1
- 4
10
votes
2 answers
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 with a photo in state I could write something like…

connected_user
- 477
- 4
- 11
8
votes
1 answer
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…

Dan Roberts
- 303
- 1
- 6
5
votes
3 answers
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 multiple files named reducer.ts and each file is…

lahory
- 305
- 1
- 7
5
votes
2 answers
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 sprinkle javascript on to the pages (potentially…

SegFaultDev
- 109
- 6
4
votes
1 answer
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: how is Virtual DOM lightweight? Since it can't…

devdevdove
- 147
- 1
- 3
4
votes
1 answer
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.
Postgresql will be the DB. I want to use…

Ketra
- 41
- 2
4
votes
2 answers
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 adapter to the database. However, what with…

Łukasz Zaroda
- 321
- 2
- 8
4
votes
1 answer
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 out nicely.
I'm actually really happy with the…

Rico Kahler
- 240
- 2
- 10