Logo

dev-resources.site

for different kinds of informations.

What i knew about react!(These are the things that I've found challenging so far on my react journey.)

Published at
11/24/2022
Categories
webdev
beginners
react
replit
Author
devangi01
Categories
4 categories in total
webdev
open
beginners
open
react
open
replit
open
Author
9 person written this
devangi01
open
What i knew about react!(These are the things that I've found challenging so far on my react journey.)

A couple weeks ago I started learning on React js. Not only was it my first React application, but it was also my first React js application, so a lot was new to me all in one go.

here are a few things I wish I knew before I got started.

What’s the difference between a library and a framework?

Let’s use an analogy of trying to build a house. With a framework, you’re essentially given all the materials to build that house, and it’s up to you in what arrangement you put them in. You will very rarely need to step outside the materials you have been given to use something third-party and, in some cases, you may not be allowed to step outside the materials.

With a library, on the other hand, you start with essentially nothing. The library’s materials are a limited set in comparison to a framework’s materials, and you can pick/choose when you want to use them and when you want to step outside that and use third-party materials.

React is a library not a framework

I sort of assumed this was more of a technicality, rather than a key piece of information around which I should redefine my expectations.

React is a UI library

React is a not only a library, it’s specifically for User Interfaces.for the most part, doesn’t change the way you write Javascript that isn’t directly related to your UI, but it heavily controls the way you write HTML and CSS (or the equivalent of it).

useEffect is a major 🔑

The code within a useEffect() block runs on each re-render, we can choose to execute them only when certain values have changed or just once. We do this by passing a second argument to useEffect(), with an array of variables that, if their value should change, we want the function to be run again.

const BetterExamplePage = (props) => {

    const [user, setUser] = useState();

    useEffect(() => {
        getUser().then((u) => setUser(u));
    }, [ /* dependencies */ ]);

    return (
        …
    );
};
Enter fullscreen mode Exit fullscreen mode

If we leave the array empty, that effectively means that the function will only run once.

replit Article's
30 articles in total
Favicon
How to use proxy IP to deal with dynamically changing anti-crawler challenges?
Favicon
Calling all Replit users!
Favicon
Baby meets AI: Creating a health tracking 👶 web-app in 15 min with an AI agent 🤖.
Favicon
The Fall of a Community
Favicon
FINDING REPLIT ALTERNATIVE FOR LEARNING CODE
Favicon
I'm come back.
Favicon
Changes to Replit's Starter Plan: Announced Friday
Favicon
Replit Tutorial: How to Code Like a Pro with AI Agents
Favicon
1 chi dars
Favicon
Destiny or Coincidence: Based on Shannon Perry s Experiment.
Favicon
So I completed Replit's free 100 Days of Python course
Favicon
Replit's 100 Days of Code (Days 2-12)
Favicon
AI’s a global affair. But Google’s Project isn’t there?
Favicon
How to make martech POCs easier
Favicon
解決 Replit 猜錯套件安裝的問題
Favicon
@TopDown On Replit
Favicon
The State of Replit
Favicon
Implement SEO Cron Jobs with Replit and SerpApi Code
Favicon
How to .go : For
Favicon
How to .go
Favicon
Building a Mortal Kombat Website
Favicon
What i knew about react!(These are the things that I've found challenging so far on my react journey.)
Favicon
How to code almost every programming language in your phone ?
Favicon
Installing ffmpeg in repl.it
Favicon
CRM app with Node.js, Replit, and MongoDB
Favicon
Building a Discord bot with Node.js and Replit
Favicon
Packaging software with Nix
Favicon
Playing with REMIX
Favicon
Best cloud IDEs?
Favicon
Build a smart contract oracle with Solidity, Node.js, and Replit

Featured ones: