All Questions
14 questions
1
vote
3
answers
238
views
Does ReactJS Compound Pattern violate the DRY principle?
Let's say we have this component:
const Card = ({ title, description, price, tag, category }) => {
return (
<div>
{title && <h5>{title}</h5>}
{...
0
votes
0
answers
91
views
Best Practices for Managing State in React Applications
I'm currently developing a web application using React and I'm looking for the best practices for managing state effectively. I've come across several methods such as using the Context API, Redux, and ...
3
votes
2
answers
1k
views
What is the Advantage of React JS over Pure Javascript + PHP?
What exactly is the purpose of React JS? I've heard a few things, like:
It updates the page without refreshing.
It is modular and can reduce redundant coding.
It is faster than updating the DOM ...
1
vote
2
answers
3k
views
Preventing parent component re-rendering of a big React component when you "Lift State Up"
I have a very big form - let's call it <MyForm> - consisting of the following:
text fields and dropdowns
custom selector made of selectable cards
table input (for this example 50 rows with each ...
-3
votes
1
answer
138
views
Sharing React Native Component as a "black box"
I'm looking for a way to share a React Native component with 3rd parties without having to share the actual source code.
Something like a .jar in Java or a .dll for C#.
So assuming we have company A ...
1
vote
1
answer
626
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>
&...
5
votes
3
answers
609
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 ...
2
votes
0
answers
2k
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
1
answer
1k
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
1
answer
105
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
votes
1
answer
215
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 ...
2
votes
0
answers
115
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: "[email protected],
licence: "...
-2
votes
1
answer
726
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
1
answer
114
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 ...