Is 500 lines too big for a React component? [closed] - javascript

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I am building a Table component that has filters on it and therefore there is a lot of logic involved and also I am using material ui which uses a lot of lines. However I am finding the component to be too extense. Is having a component with this size ok?

This is mostly a matter of personal choice.
In my opinion, I would say no. I try to keep my components as small as possible.
Try breaking down your component into smaller components that you find are re-used lots.
Otherwise, if your component is well-documented, I would say 500 lines is okay.
It mostly depends on what the component is and the complexity of it.
It's totally up to you though!

Related

Is it better to write react components first as one HTML file then turning them into components? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I wonder if writing react components as HTML first can be a good idea to plan the project or it is actually a bad idea and time consuming??
Though, this is primarily opinion based question, the react documentation simply states to follow these rules:
Start With A Mock
Break The UI Into A Component Hierarchy
Build A Static Version in React
Identify The Minimal (but complete) Representation Of UI State
Identify Where Your State Should Live
Add Inverse Data Flow
See Thinking in React for more info.

React / Redux connect when used [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
i would like to know, if i must use 'connect' in children component or i must traced back my function in Parent component which is already 'connect'
What the best practice?
Fred
Per the Redux FAQ entry on connecting multiple components, you should feel free to connect components anywhere it makes sense for your own application.

reactJS doubts and questions [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
Hello guys I would like to use reactJS but it's not clear for me why do I have to use it, I already use Jquery and it works fine for me, I can use Java script and manipulate all the DOM the issue here is why? Why should i use it and what kind of things I can do with reactJS that I could not make with Jquery.
I hope you can give a hand or simple examples because I'm very confused thank you.
One of the biggest advantages is the component system for writing code. You can build all your html in blocks and then just import those blocks where you need them. You can also modify how those blocks are loaded using the component lifecycle for added control and optimisation.
These methods really help structure how you perceive information flow throughout your site.

Comparison of ReactJS with AngularJS [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
What are the performance based advantages of ReactJS when compared to the Angular2?
You can check out this comparison of the two through which ReactJS is rendered out as the easiest to use over AngularJS. But I'd like to also stress that this is purely opinionated and this might change depending on the application being developed and its context.
For further information, you can refer this.
Right now, I mean today:
ReactJS is mature (version 15.x)
whereas Angular2 is in RC5 (not mature)
So:
React is a today or middle term best bet in term of performance (rendering, bundle size etc...)
Angular2 (if it does what it is promised to do later!) should be a long term bet.

Memory usage in JavaScript/browser [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
This will be a bit strange question, but..
I am planning to use jQuery/knockout to write a dynamic custom wizard
which will depending on different scenarios will load different templates/UI logic to the user.
Question.
Should I take into consideration memory usage in this case? or should I manually unload/clean up/save to the server pieces of UI which is not in use??
PS. Current version of wizard will have 5-7 steps.
You should write your app the best you can functionally and then determine if memory is even an issue. If it is, then you can take steps to reduce it's memory footprint but odds are you'll be fine. For instance, go look at what a site like Facebook's memory usage, a site that everyone and their grandmother uses.

Categories