Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
My question is about the standards of React and JSX. I am unsure how to formulate a page using React. Do I break down my page into components and render everything through JSX? Or is it a combination of HTML with rendered components strewn throughout?
I have been unable to find any succinct response to this question, but from what I have gathered, is that I break the webpage into only components.
It's a combination of HTML with rendered components strewn throughout. You can however also have only one master "component" to render the entire app and it's "sub" components rendered within.
I don't think the term component is the best one here but I get what you mean rather I think you mean React Element.
Generally it is preferred and easier to just use React Elements where you need React eg for a search bar and have everything else in HTML.
Related
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 2 years ago.
Improve this question
I'm learning ReactJS, I know that react is about declaring the way something should render, giving it some data and poof, when the data changes, it renders those changes.
But if I want to manipulate the DOM, an example change a color, create a accordion, make animations, add and remove a class, etc.
React can do that? Could I migrate my jQuery projects to Reactjs without any problem?
There are many approaches for that task, a complete list is here in the official Docs. Either use React as a Wrapper on top of your jQuery Application or Translate your jQuery App to a React App.
From the official Docs
React is unaware of changes made to the DOM outside of React. It determines updates based on its own internal representation, and if the same DOM nodes are manipulated by another library, React gets confused and has no way to recover.
This does not mean it is impossible or even necessarily difficult to combine React with other ways of affecting the DOM, you just have to be mindful of what each is doing.
The easiest way to avoid conflicts is to prevent the React component from updating. You can do this by rendering elements that React has no reason to update, like an empty .
Here is a medium article that may help you.
How-my-team-converted-our-website-from-jquery-to-react-in-small-steps
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!
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.
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
I'm about to choose whether to use React Navigation or to use React Router Native, I thought that React Navigation is better, but then I found some feedbacks like this react navigation issue, ps: React Router Native has similar API to React Router which seems very simple, I'm still lost! I need an advice
In my experience React Navigation works like a charm. It uses native-alike layouts if you don't wanna create your own, and let you customize them via props as you wish. It also lets you navigate inside functions without the need of redux actions, which i think are a must in React Router.
The main problem of React Navigation is its documentation, which is pretty lackluster. It has no complex examples, only simple stuff, so you have to lurk a little bit to do some stuff if your app starts getting complex, with a lot of nests.
Even so, the only hard to solve problem i really had with React Navigation was when i had a Stack Navigator (2nd) inside a Drawer Navigator which was nested inside a main Stack Navigator (1st), which back then wouldn't let me change the main header from within the 2nd Stack Navigator. This could be worked around by putting the 2nd Stack Navigator directly inside the main one.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am working on a web application using MEAN stack. I will be using two types of layouts for my pages.
Layout 1 - the full page used as the content area.
Layout 2 - layout 2 has a top banner and a sidebar. The content area is in the center.
I would like to know what is the best way to implement this using angular js. I am new to angular js development.
I hope the description explains the problem well.
Do it as a single page application using ui-router for injecting template
Example1 here...
Example2 here...
Angular is modular template based language, and easily you can build singe page app.
using ui-router you can change the part of page without changing url or without refreshing.