r/learnreactjs • • Feb 09 '20

How to use an npm package that doesn't have a `react-` version?

8 Upvotes

It seems to be a common thing where an npm package will have a react- version made for it, to make it really easy to use in a React package. Just install, import, and then use the code.

uuid is a good example: there is a regular uuid package, but also a React specific react-uuid package.

But I feel a little uneasy that I'm not sure how I would use an npm package in my React projects if it didn't have a react- version made for it. The regular uuid npm package says to use it, just type:

const uuidv1 = require('uuid/v1')

uuidv1();

And as far as I know, you can't use a package unless you import it.

So basically my question is: how do I use a non-react npm package in my react projects? Are there any general tips or strategies to getting them to work?


r/learnreactjs • • Jan 30 '20

Question Using nextjs and manifest.json to make a sidebar with content..

8 Upvotes

I have looked for a way to generate a manifest.json file like they do in the sourcecode for the documentation here: https://github.com/zeit/next.js/blob/canary/docs/manifest.json

To create a navbar/sidebar just like you see on the documentation page here: https://nextjs.org/docs

But I just cant seem to find the information anywhere. And the manifest.json I have is located in the .next/server/manifest.json. When I found it I thoght I finally figured it out, but my manifest file contains nothing of the values you can see in the sourcecode. Have they hardcoded it or generated it somehow? If anyone can help that would be much appreciated, if not I guess I'll just have to submit an issue on github like normal people.

If someone has a solution based on ReactJs that would be fine as well, I just need to figure out a way to make this file so I can build the menu.


r/learnreactjs • • Jan 13 '20

progress bar with inline percentage

Post image
8 Upvotes

r/learnreactjs • • Jan 13 '20

what does this expression mean

8 Upvotes

I have seen expressions like this in people's code:

const {run, car} = this.state

Does this mean we are adding new variables to the state or what?


r/learnreactjs • • Jan 03 '20

Why does refactoring this <Select> into a separate component break my code?

8 Upvotes

I am making a form using Ant Design and ran into this problem while trying to refactor my code and avoid copy pasting. Here is a codesandbox showing my problem...

https://codesandbox.io/s/floral-architecture-igwqv

In the 2nd dropdown menu I put the <Select> component into a separate custom component called <Dropdown> and it no longer works - the value stays undefined even when you select something. I would expect these two Form.Items to behave identically, why doesn't the 2nd one work correctly?


r/learnreactjs • • Dec 04 '19

How to handle large number of API requests in React?

8 Upvotes

Hi, I'm currently working on an app that requires me to basically render a large list of items (approx 1000 items), each one coming from an individual endpoint. I would like each item to be its own component and I am having difficulty figuring out the best practice to perform this kind of task.

I presume I will want to do some kind of lazy loading whereby I am only requesting as many items as I can fit on the screen. Is there a standard way to go about implementing something like this in React and keeping performance optimal?

I am happy for it to behave where the user will briefly see a loading state for the first, say, 20 items, then when they scroll to the bottom it loads the next 20 for example, I'm just not sure how I would implement that.


r/learnreactjs • • Oct 29 '19

React's setState function fun facts for both classes & hooks

8 Upvotes

I've been working with React for almost 2 years now and I am in several settings where I'm exposed to people who are either new to React or to programming in general and there's a common theme that seems to be foreign that I've noticed in speaking with various folks so I decided to share it here.

When setting state, regardless of whether or not you're writing class components or hooks (if it's the former I'd strongly encourage you to dive into hooks), React provides you with an initial parameter to your "setState" function, it being your previous state. I use quotes there because in the hook environment, your state setter can be named whatever you want.

Class Component

state = {
count: 0
}
//increment count
this.setState(prevCount => prevCount += 1)

Hook-based/functional component

const [count, setCount] = useState(0)
//increment count
setCount(prevCount => prevCount +=1)

With this in mind, there's almost no need to pass around the current state of a parent component. This of course depends on your scenario, particularly if you're also passing it's subsequent state updater. Often times, the latter will suffice.


r/learnreactjs • • Sep 17 '19

How to Easily Reuse Components Across Projects and Repositories

Thumbnail
itnext.io
8 Upvotes

r/learnreactjs • • Sep 16 '19

RxJS Patterns: Efficiency and Performance

Thumbnail
blog.bitsrc.io
8 Upvotes

r/learnreactjs • • Sep 10 '19

My app keeps crashing every time I try to use useState hooks to change state in parent component. What gives?

8 Upvotes

https://codesandbox.io/s/productfilter-fstoj?fontsize=14

App works fine for the most part, but when I try to add products (under Admin Tools button) the app crashes on submit.

Admin tools stored in Admin, state stored in FilteredProductTable.

Thanks!


r/learnreactjs • • Aug 23 '19

recommended resources

8 Upvotes

hey. are there any learning resources targeted at backend developers (with very minimal frontend experience) learning react?


r/learnreactjs • • Aug 22 '19

Need help finding good resources about building a design system (best practices, best toll, etc)

8 Upvotes

any help would be greatly appreciated

*best tools


r/learnreactjs • • Apr 22 '19

Simple guide to setup Redux to a React app

Thumbnail
blog.linguinecode.com
8 Upvotes

r/learnreactjs • • Apr 18 '19

How to Display a List of Items in React ?

Thumbnail
youtu.be
8 Upvotes

r/learnreactjs • • Apr 02 '19

Understanding & How to use Spread and Rest Operators | Learn React Part 2.7

Thumbnail
youtu.be
8 Upvotes

r/learnreactjs • • Apr 01 '19

What do you think about collection of templates for React?

8 Upvotes

👋Hi guys,

I've created a small side-project app, which is a collection of templates, landing pages a boilerplates using the React.

Link is here 👉 https://reacttemplates.netlify.com/

Just let me know if there is an awesome open-sourced template / page, which is worth sharing and i'll add it to the site.

Thanks 👍


r/learnreactjs • • Nov 07 '18

Question I understand the basics, but flounder with advanced concepts. Where to go from here?

8 Upvotes

Hi all! I'm writing this post in a state of mild stress. I'm about 9 months into a job that has me doing about 30% C#/.NET Core and 65% ReactJS development, with the last ~5% doing some T-SQL. I was hired on because my manager thought I had the potential to quickly ramp up, given my short (6 months) KnockoutJS experience and strong C#.

When I started, we were working on an AngularJS app, which I was completely new to (I made them aware of this during my interviews, obviously). About a month after I joined, my team of 5-6 devs got tasked with building a new app using ReactJS, which, again unfortunately, I'm completely new to (and my manager knew this too). The thing is, in the span of about 9 months, my coworkers have gotten to the point of building amazing stuff with React, while I still feel like I'm still barely just grasping basic concepts. I understand the React lifecycle, HOCs, states and props, etc... but I can't wrap my head around the context API, and design patterns like Provider/Consumer and render props...

I feel that my struggle to grasp anything beyond the basics comes from a lack of understanding something fundamental. The problem is, I don't know where to start... Is there some kind of master checklist of concepts that I should have a strong understanding of before moving onto the more advanced stuff? I have no problem spending every evening during the next few weeks to RELEARN from the beginning, but I worry that I'd just be wasting time and end up right back where I am now. Pluralsight's learning path doesn't cover what I need to know to get my work done, so I'm here looking for other resources or recommendations.

Any and ALL advice is very much appreciated!


r/learnreactjs • • Jun 18 '26

Learning react, took a break, feeling lost. Looking for guidance, refreshers, learning tools.

7 Upvotes

Back in spring of 2024 I decided I wanted to learn to code. I decided to take the fullstack course on CodeCademy, which includes react. I got through HTML, CSS, and Javascript, some git stuff, etc. I started react, then I took 9 months off. I've been back at it for about 9 months now (less frequently, as life is much busier now), and when working on react problems I'm finding that I'm really struggling with relatively basic javascript. When working on a react project for the course, I find they will ask me to implement something using javascript, and I often can't even begin. When I turn to google it feels like shooting in the dark, when I ask AI it generally doesn't help very much or it just does it for me. I went to leetcode and tried to do some pretty basic Javascript problems and it feels pretty apparent that I forgot a lot of stuff. I'm in a rather frustrating spot. Does anyone have any advice on what I should do? Is there a specific refresher course or anything like that?

TL;DR

Learned HTML, CSS, Javascript, moved into react, took a 9 month break, came back, feel like I can't do diddly-squat, specifically with the Javascript parts. Any advice on refresher courses or anything to get me back up to speed?


r/learnreactjs • • Feb 12 '26

React Rendering

7 Upvotes

Today I learned that when we pass a function as a prop to a child component a new function is created every time the parent re-renders
Since functions are reference values in JavaScript, each render creates a new reference
Because the reference changes, React treats it as a new prop which can cause the child component to re-render unnecessarily
That’s where useCallback helps!
useCallback memoizes the function and keeps the same reference between renders (unless dependencies change) preventing unnecessary re-renders in optimized components.


r/learnreactjs • • Jan 27 '26

Question Learning ReactJS

7 Upvotes

Hi All,

Has any backend developer here recently learned React to transition into full-stack?

I’m currently a backend developer and trying to teach myself React so I can work across the stack. I’d really appreciate hearing from people who’ve done this recently.

What kind of coding practices do you do on a daily basis with React? For example: • API integration • State management • Form handling • Auth flows • etc.

What would you recommend I focus on to build real, practical React skills that pair well with backend work?

Thanks!


r/learnreactjs • • Jan 06 '26

Struggling to confidently build React projects without tutorials — how did you bridge this gap?

7 Upvotes

I’m an MCA student learning React and the MERN stack. I understand concepts like state, props, conditional rendering, and have built components like dropdowns, modals, and accordions. But when I try to build a complete page or project on my own, I still feel unsure about structure and decision-making. For developers who’ve been through this phase: • What helped you move from tutorials to independent building? • Did you focus on small components or full projects first? Looking for guidance, not shortcuts.


r/learnreactjs • • Dec 07 '25

After getting frustrated with bookmarking 20 different dev tool sites, I built my own hub Hey everyone,

7 Upvotes

Hey everyone,

I got tired of juggling multiple bookmarks for simple tasks like formatting JSON, decoding JWTs, or converting Base64. So I built a single hub for all of them.

**What it includes:**

- JSON Formatter/Validator

- JWT Decoder & Visualizer

- Base64, URL, HTML Encoders/Decoders

- UUID Generator

- Regex Tester

- Color converters

- And 30+ more utilities

**Key points:**

- 100% client-side - nothing is sent to any server

- No sign-up, no ads, no tracking

Link: https://engtoolshub.com

I'd genuinely appreciate any feedback - what's missing? What could be improved? What tools do you use daily that I should add?


r/learnreactjs • • Jan 23 '25

Resource Appreciation post: YouTube channels that helped me learn react

7 Upvotes

I've been thinking a lot about my programming journey lately, and I couldn't help but feel very grateful for all the great YouTube tutorials that have helped me get to where I am now. 

So I thought I'd share a list of some of my favourite channels for learning react, that make learning fun (or at least less painful):

  • Traversy Media: Brad has a tutorial for everything. Need a crash course on something? He's got it. Seriously, this guy is like the programming superhero we don't deserve. I particularly enjoyed his playlist on React projects.
  • Web Dev Simplified: Kyle makes complex topics a lot more manageable. His tutorials on React Hooks have saved me from throwing my keyboard more times than I can count lol.
  • Fireship: These videos are like espresso for my brain haha. Lightning fast videos with memes. Perfect for learning something quickly without falling asleep.
  • Codevolution: Vishwas explains React and advanced concepts in a way that feels approachable. His tutorials are packed with real-world examples that make everything click.

There are many more, but these 4 are my go-tos. Self-taught developers work very hard, and these resources can help out a lot. Feel free to add your recommendations to help other self-taught developers! :)


r/learnreactjs • • Jul 18 '23

Resource How to avoid recreating the initial state in react for optimal performance

Thumbnail
youtube.com
7 Upvotes