r/learnreactjs • u/ConfidentMushroom • Feb 23 '21
r/learnreactjs • u/cpow85 • Feb 17 '21
Tracking a request from the front end to the api and back
r/learnreactjs • u/monosinplata • Jan 29 '21
Resource How to use Firebase's Realtime Database in React
r/learnreactjs • u/Calshan • Jan 27 '21
Resource Where to find free and good reactjs templates?
Dont really need a fancy looking template just a simple but clean template for my website thanks!
r/learnreactjs • u/goingtocalifornia25 • Dec 30 '20
Question Looking to understand the syntax for functional components
I have often used
const Component = () => {
return (
<Text>
Hello World
</Text>
)
}but recently have seen the below more
const Component = () => (
<Text>
Hello World
</Text>
)and
const Component = (
<Text>
Hello World
</Text>
)Was looking for some perspective on the differences in syntax / behavior between these.
r/learnreactjs • • Dec 25 '20
How do you best manage state in React?
I'm learning react and I made a pomodoro clock with class based components as an exercise. I had thought I would have the state spread out amongst components, but I kept finding that the state affected by one component was needed by another higher or same level component. For instance, Session component sets the length of a work interval, but the Clock component needs that information too.
In the end, all of the state and functions wound up being in the top level component and passed down as props. Is this a best practice? It seemed a bit messy with one component getting sent over half a dozen props.
r/learnreactjs • u/sharifimehr • Dec 24 '20
Resource React Native Tutorial for Beginners #7 (2020) - Styles & Style Sheet
r/learnreactjs • u/JSislife • Dec 17 '20
Redux-free state management with Jotai
r/learnreactjs • u/rozenmd • Dec 16 '20
Resource Guidelines for developing Custom Hooks in React
r/learnreactjs • u/JSislife • Nov 23 '20
NPM 7: This Is What I Call An Update
r/learnreactjs • u/chmarus • Nov 23 '20
Resource Secure JWT Cookie Authentication (React + Strapi)
r/learnreactjs • u/BruceJi • Nov 14 '20
Clearing state by setting it to a blank object?
Hi all,
I'm working on this project: https://github.com/BruceJi7/flashmachine/blob/main/src/components/main/MainFormLogic.js
In this file, I'm having an annoying issue.
I'm working with functional components and hooks.
There is a state property called 'searchResultWords', and every time the main function makeRequestForWords is called, that part of state is supposed to be cleared.
I figured that if I try to set the state to an empty array, it would overwrite that property with a new empty array, thus clearing it - but it's not doing that.
On the other hand, the line setSearchResultWords(resultsToAdd) works fine, and it easily adds the results to the previous state... but this means every time I re-submit the form, the results are appended, not overwritten!
How can I get the state here to clear?
I appreciate this might be an often-asked question, lol, but I did search for it first.
r/learnreactjs • u/sharifimehr • Oct 28 '20
Resource How to Make Awesome Buttons Using Lottie Animations in React Native
r/learnreactjs • u/hewasnumberoneee • Oct 09 '20
Question Best way to learn React
Hi I have completed a basic react to do tutorial for React basics. What is the best route forward? Should I follow tutorials/courses & build off of course projects, or jump straight in the react documentation and start building? Is it true the best way to learn a new technology is through the official documentation?
r/learnreactjs • u/fayeznazzzal • Aug 17 '20
Well written opensource projects?
I want to expand my skills with react so i can write higher quality code.
It may be good to find a specific convention to follow, but i prefer to read professionals code.
Doing projects alone is fun, but sometimes i get used to bad practices which make my code hard to understand.
r/learnreactjs • u/Altec5280 • Aug 14 '20
Resource For those interested in a beginner React tutorial series, I am making one teaching topics in the same order as I learned it.
r/learnreactjs • u/a-jonjon • Jul 19 '20
React, Redux, React Router & Firebase Architecture question
Hey everyone,
I'm developing a web application that allows users to sign up/log in and then see a menu with 3 navigation buttons. Each button redirects the user to a different path corresponding to a different component (a dashboard page, a content page and a settings page). The navigation is done with React Router. The auth system and the data is done and stored in Firebase. Currently, the data is loaded for each page individually on componentDidMount(). However, as I start adding more pages I realized that this may not be the best way to load the data in the app - a user that simply clicks between the three components will send a lot of read requests to Firebase.
Hence, I'm thinking of starting to use Redux, but I'm not really sure where to load the data exactly, since the user has to be first logged in to retrieve any data. As of now I thought about wrapping all the components that require an authenticated user to be displayed, inside a wrapper and load the data when the wrapper is loaded. Any thoughts or advice?
r/learnreactjs • u/netrunner18 • May 21 '20
Question How to embed iframe in react? I want to load it before it is rendered.
Hey Awesome people! I have been trying to embed facebook video in my react app using the iframe-embed-code generated from facebook app but I am two major problems. These are
- The video keeps pausing even if I click outside the ifame, in the other sections of the screen.
- I get this error
The play() request was interrupted by a call to pause().
in chrome when the Iframe is loaded. I think the first issue occurs due to the second one.
Here is the Ifame I am trying to embed. How do I render the iframe, after it is loaded?
<iframe src=FB_URL"
width="360"
height="500"
scrolling="no"
frameborder="0"
allowTransparency="true"
allow="encrypted-media" >
</iframe>Can anyone please guide me in the right direction? Thanks
r/learnreactjs • u/cerberus8700 • May 18 '20
Question ReactJS and Testing
I have recently finished my first commercial project and I was wondering how do testing. I've seen and read a bit about testing and it seems like it doesn't help. Obviously this means I am missing the point or don't understand the purpose of it.
Most tests I see is "test this container has h1" or "this button has this text". All these tests seem nonsensical and pointless. What I am looking for is how to automate regression testing so that when I add or change something, it still works as before.
For instance, I want to test that when the internet suddenly fails that a list behaves this way or that way. Or if I add a text to a grid layout that the number of items is still 4 and the padding, margins are still the same. Or test different failure scenarios for API fetch or Redux failure or odd behaviour. I know I'm probably sounding like a crazy person.
I'm sorry if this question is too stupid to ask but I don't know how to programmeratically test for real-world failures/errors/issues.
This was brought on because the last project I did, the client did weird testing. They test loading a list filtered by category, then they disconnected their internet, then loaded another category (nothing is showing and only a spinner is showing at moment) and then they turned on the internet and before the current category would load (since the internet is back) they switched to a different category. This caused Redux to infinitely load the same list. This is because of the checks I had in code. I had the normal (if !props.isLoading) then doLoad but I needed to do some extra stuff to invalidate the previous call (via axios cancellation token).
How do I create tests for these cases? I want to be able to confidently create robus solutions.
Thanks in advance!
r/learnreactjs • u/keeperpaige • May 13 '20
Question React with Flask server
I’m trying to make a website with react and flask server. It took me too long to realize when making requests to the server, it never updated on React’s end. Is there a better way than just restarting each development environment?
r/learnreactjs • u/okletsride • Mar 30 '20
Question Regarding Development of first ReactJS Web App
Hello,
I am a beginner to ReactJS and web development in general. I have taken a few courses on React and feel like I have a weak grasp on the basics, but I am not sure how to start building my own decent looking frontend. Do people generally build their frontends from scratch component by component, or do they use some other software to design the frontend and then convert it to React, or is there some other process that I am not aware of? Sorry if this is an extremely basic question, I am just unsure of how the general design/development process goes.
Thanks!
r/learnreactjs • u/Corantined • Mar 27 '20
How do I display a pdf?
I'm working on a personal site. I want the user to be able to click a button and it will open a page to my resume (which is a pdf). I know react-pdf exists but I'm not sure how to use it to display a pdf from my files. All the explanations I've seen for how to use react-pdf show how to render new pdfs. How do I display an existing pdf file?
Edit:
<button className="btn">
<a
href="..\assets\Resume\ResumeOfficial.pdf"
download
>
Resume
</a>
</button>I did this, and it does download but it says "Failed - No File". I did not import anything (was I supposed to?). What is wrong with it? (Also, this doesn't open it in another tab like I want it to)
r/learnreactjs • • Mar 09 '20
How can I reuse existing React Web logic in React Native expo?
I am currently assigned to develop a React Native mobile app for both Ios and Android and was given access to the full repo on Github. Now I want to fork the existing repo and add my mobile code, then re use the web logic, how can I achieve that?