Pure Components in React Native using Expo [closed] - reactjs

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 2 years ago.
Improve this question
I started to work with React Native using Expo and I am trying to figure out what the best practices are. Due to my previous experience, I would like to avoid performance issues before they going to be difficult to handle. I've read some articles about Pure Components which seem to help to improve the performance. My question is whether Pure Components are compatible with the expo or if it even has something to do with Expo? I couldn't find any relevant information about it online.

Pure components has nothing to do with Expo. They are part of the React fundamentals.
It is impossible to teach you through a comment here the react lifecycles and performance optimizations so my best advises to you are:
Read a little bit about the react life cycles and understand when component gets rendered.
Use functional component and hooks as they will make your life much easier and it is the "modern" way to use react.
For performance improvement read a little bit about the RN bridge and learn "useMemo", "React.memo", "useCallback". The best way for me to get deeper understaning after reading documentation was watching YouTube videos. I really recommend the "Web Dev Simplified" channel.

Related

React Context Vs Redux [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 1 year ago.
Improve this question
I am a student trying to learn web development along with the ReactJs library. But I have a huge struggle selecting between React Context and Redux state management. I have never worked on real-time huge projects. So everyone is suggesting I should go with React context. Even my friend who is working on a real-time project in the IT field is using React Context instead of Redux in their project. So he suggests I should just stick with React Context. But I think Redux was there even before React context and is really suitable for huge projects. So a lot of the older projects may be using Redux. But Redux is really hard compared to React Context.
Can anyone give me a suggestion on whether I should just stick with React Context or I should learn Redux?
Depends on the scope of your project. There can be some problems with React Context with high frequency updates, but if it is mostly low frequency ( theme changes, authentication ) then just use React Context because it's simply better if you plan to use the data only in ReactJS and it's additional packages
Actually it is a good idea to know both. I would start with React context which is much smaller and easier to grasp, and out of the box.
Then you can switch to redux - and do some work with it. You will learn both since both are not that difficult.

When should you use a front-end framework like Angular or React, and when just use plain HTML/CSS/JS? [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 2 years ago.
Improve this question
I know that for a simple static website, using plain HTML.. is the easiest and quickest way. But, what are some use cases between the two options? Is using a framework mostly the best solution?
You can basically see frameworks as pre-written structures for your App.
In other words, frameworks are meant to help you building applications quicker by addressing common development problems.
So, going back to your question, there are not really times where you would prefer vanilla javascript over frontend frameworks due to the incapacity of scaling well, which could result in inscrutable and unmaintainable spaghetti code.
Other bit you would want to consider about frameworks, is their high performance obtained thanks to their virtual DOM (abstract map of the real DOM), which helps handling events to update parts of the App without the need of re-rendering it.
On the other hand, I would suggest to go with a static website using pure HTML and Vanilla JS, only if learning / instructing someone, or if building something really really simple (but rest assure 99% of your commercial websites may suit better under a framework rather than without).
If you want to read more about it, I would suggest the following articles:
https://stackoverflow.blog/2020/02/03/is-it-time-for-a-front-end-framework/
https://gomakethings.com/why-do-people-choose-frameworks-over-vanilla-js/
https://www.freecodecamp.org/news/do-we-still-need-javascript-frameworks-42576735949b/

Should I use Firebase with react. Alternative to Firebase as backend [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 2 years ago.
Improve this question
I am taking this course building a chat app with react and firebase as backend. The problem is when I got to connecting react, redux, and firebase the whole process became so complex that got me wondering what's the point of Libraries, Frameworks, and SDK if not to make the development process easier or faster at least. Please is there other alternatives to using Firebase as backend with react. (Without so many add-ons, helper-functions, and enhancers that I need to connect)
There are quite a few alternatives: PubNub etc.. but all of them will require some setup and config to make it work with react. firebase by itself is not complicated, but make it work with react piles up the complexity a bit.
Just try it a bit more and once you are done with config and setup it way more fun. Here is a simple example to try: https://www.codementor.io/#yurio/all-you-need-is-react-firebase-4v7g9p4kf
The title doesn't explain your problem. I think its not firebase thats getting in the way, but in-fact redux/ react-redux-firebase.
If you're just learning react, you should not be trying redux. Redux has a steep learning curve, and will get in the way of you understanding the real part of react. Kent C. Dodds has said:
guess what, you probably don't need a library like Redux anymore
This might be speculation, but redux might not be as popular in the future, so you might not even have to learn it in the future. You can just use Context. People often abuse redux.

Integrating Angular 2 with React [closed]

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 6 years ago.
Improve this question
Has anybody seen any good integration using both Angular 2 and React? This video indicates that it's possible: https://www.youtube.com/watch?v=XQM0K6YG18s
I would really like to have the below in my new project if that's possible:
Angular 2 web worker, service worker - https://www.oreilly.com/ideas/angular-2-and-the-future-of-html5-apps - e.g. to separate UI drawing and calculation to run on different CPU cores
Redux data flow - e.g. maybe using react-redux or ng2-redux to connect container component with presentational component
React inline style - e.g. Radium - http://stack.formidable.com/radium/, and this video explains why: https://www.youtube.com/watch?v=NoaxsCi13yQ
The challenges:
How do I draw a line between the code that should be written in Angular 2 and React
What should be compiled first, React JSX or Typescript? - this video shows that Typescript with React is not easy: https://www.youtube.com/watch?v=9PTa9-PPVAc
I know this question is likely not to have a definite answer, but if anybody know any active project trying to solve this (I can't find it), it would massively help my investigation.
Thanks in advance.
Update in Aug/2016
It's worth pointing out that react-typescript is doable, and there is now an reliable (created by the mobx creator) boilerplate mobx-react-typescript-boilerplate available (shame on me I haven't tried).
For anybody who has interest, mobx is a functional reactive framework that works well with React and came after Redux. See State Management is Easy on Youtube.

Should I learn React Before Learning Clojurescript Om? [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 3 years ago.
Improve this question
I'm going to learn Clojurescript for building UIs and I want to use the React wrapper.Should I learn React before diving into Om?
Learn ClojureScript first, don't even think about React.
The learning curve for Om is not straightforward and you'll need to have a fairly grounded understanding of the fundamentals of the language before some of the abstractions that come with Om make sense (atoms, protocols etc). It's designed to be powerful, not simple and accessible.
Honestly, I'd try Re-agent first. The syntax for describing views is nice out-of-the-box and it'll also help solidify your understanding of atoms. If you like it, then you can complement it with Re-frame for a full blown FRP architecture.
I think it's easier to learn Om coming from Re-agent or Re-frame, than it is from React.
No, just dive into Om (or Reagent).
For 99% of UI concerns you won't need to know about the underlying React details, eventually for that 1% of cases you'll need to refer to the React docs.
I wouldn't worry too much about React. You can learn it through Reagent. Dive straight into Reagent by reading existing code. I started with the Flappy Bird demo and a few others.
To understand React you could look for uses of componentDidMount and the other component lifecycle methods. But honestly you only need to understand these methods for special use cases. Each item having to have a unique key is something that will trip you up, but only for legacy code as that requirement has been removed in the latest version of React.
You could also, even right from the beginning, be reading Om Next code and tutorials. You won't understand them fully right away, but keep having to go back to them. I believe that's the case for everyone!
How you approach it will also depend on whether you are a top-down or bottom-up learner. A bottom-up learner might be delighted to find out from one of the tutorials that queries have metadata linking them to components. On the other hand a top-down learner might be relieved to find a complete application to study. Here's my current best effort at a small Om Next application for understanding purposes.

Resources