Пікірлер
@stephen1569
@stephen1569 2 күн бұрын
Excellent presentation my friend. I was hoping that there might be some general detail about the JS logic of how the buffer switches the pointer. Also, do the variables actually change position in the array [ currentX, setCurrentX ] ? Maybe this might be a topic for another video? Many thanks.
@1minuteunity759
@1minuteunity759 4 күн бұрын
Great Video!
@SumanPokhrel0
@SumanPokhrel0 19 күн бұрын
What an elegantly explained video. Bravo
@sharonye8297
@sharonye8297 28 күн бұрын
nope
@user-rl8qs5su9z
@user-rl8qs5su9z Ай бұрын
as a person who dont code in Js, this f my brain up so hard
@sidharthvyas5883
@sidharthvyas5883 Ай бұрын
Awesome
@frankdearr2772
@frankdearr2772 2 ай бұрын
great topic, thanks
@BartekSpitza
@BartekSpitza 2 ай бұрын
Amazing video. This was exactly what I was looking for, sadly I had to scroll several times as the top videos titled with “how react actually works” were all just shallow reiterations of the react API.. thank you!
@PhilipFabianek
@PhilipFabianek 2 ай бұрын
Thank you!
@danieldesales377
@danieldesales377 2 ай бұрын
Great content!
@dan-kn3dm
@dan-kn3dm 2 ай бұрын
Use 1.25 speed, thank me later. Btw nice video!
@user-vd7tc8bd3g
@user-vd7tc8bd3g 2 ай бұрын
why is there that white flash occasionally while using useLayoutEffect()?
@Stefan-xm9qb
@Stefan-xm9qb 3 ай бұрын
And how does this deep knowledge improve my skills as a react developer? I managed to successfully use react for many projects without this knowledge.
@PhilipFabianek
@PhilipFabianek 3 ай бұрын
That is a good question. I was also using React for several years before learning how it actually works. I think it gives one some satisfaction to have a rough idea of how the technology that is being used works. Additionally, I think there are some practical takeaways, for example knowing how keys work and why they are important, etc.
@Stefan-xm9qb
@Stefan-xm9qb 3 ай бұрын
I agree there is some satisfaction that I felt. And yes absolutely the thing with the keys is very important. I actually looked up some of my code and I found out I used the key incorectly: I used index as key 😱 {sectionsData.map((section, index) => ( <Container key={index} id={`section-${index}`} style={{ height: "100vh" }} > ... </Container> ))} But I guess this would be much more efficient (if the sectionsData changes like things get prepended for example): {sectionsData.map((section, index) => ( <Container key={section.id} id={section.id} style={{ height: "100vh" }} > ... </Container> ))} But do I really need to understand how the diff function works in order to apply that knowledge? I also could have just read this react documentation: Keys tell React which array item each component corresponds to, so that it can match them up later. This becomes important if your array items can move (e.g. due to sorting), get inserted, or get deleted. A well-chosen key helps React infer what exactly has happened, and make the correct updates to the DOM tree. Rather than generating keys on the fly, you should include them in your data: Pitfall You might be tempted to use an item’s index in the array as its key. In fact, that’s what React will use if you don’t specify a key at all. But the order in which you render items will change over time if an item is inserted, deleted, or if the array gets reordered. Index as a key often leads to subtle and confusing bugs. Similarly, do not generate keys on the fly, e.g. with key={Math.random()}. This will cause keys to never match up between renders, leading to all your components and DOM being recreated every time. Not only is this slow, but it will also lose any user input inside the list items. Instead, use a stable ID based on the data. Note that your components won’t receive key as a prop. It’s only used as a hint by React itself. If your component needs an ID, you have to pass it as a separate prop: <Profile key={id} userId={id} />. Source: react.dev/learn/rendering-lists Anyway now I started learning flutter and I wonder if flutter Widgets rendered as lists also need keys? I did some research and you can also provide keys in flutter to optimise re-rendering: www.flutterclutter.dev/flutter/tutorials/2023-04-08-how-to-use-keys/ But I think if I had read the react docs instead of understanding how this Diff function in react works I wouldn't have also assumed that in flutter there is a similar thing. So I don't understand how that knowledge of the react Diffing algorithm helps me. So maybe if you are trying to learn a similar but different technology maybe if you understand it in depth how the first technology works under the hood it may be helpful or may not? And I guess for static lists that don't change it's unnecessary to add keys. That's something I wouldn't have known if I wouldn't understand how the Diffing function in react works. So to summarise it is useful to have this deep knowledge for optimising and that knowledge can also be mapped to different technologies? Did I miss something? I still am not satisfied with my own answer. By the way if you could start learning React from beginning like someone would erase your memories and you would time travel in the past would you first just learn to "use" react for couple weeks and then start look into how it works under the hood or the other way around? @@PhilipFabianek
@Stefan-xm9qb
@Stefan-xm9qb 3 ай бұрын
I agree there is some satisfaction that I felt. And yes absolutely the thing with the keys is very important. I actually looked up some of my code and I found out I used the key incorectly: I used index as key 😱 {sectionsData.map((section, index) => ( <Container key={index} id={`section-${index}`} style={{ height: "100vh" }} > ... </Container> ))} But I guess this would be much more efficient and avoid some bugs: {sectionsData.map((section, index) => ( <Container key={section.id} id={section.id} style={{ height: "100vh" }} > ... </Container> ))} But do I really need to understand how the diff function works in order to apply that knowledge? I also could have just read this react documentation: Keys tell React which array item each component corresponds to, so that it can match them up later. This becomes important if your array items can move (e.g. due to sorting), get inserted, or get deleted. A well-chosen key helps React infer what exactly has happened, and make the correct updates to the DOM tree. Rather than generating keys on the fly, you should include them in your data: Pitfall You might be tempted to use an item’s index in the array as its key. In fact, that’s what React will use if you don’t specify a key at all. But the order in which you render items will change over time if an item is inserted, deleted, or if the array gets reordered. Index as a key often leads to subtle and confusing bugs. Similarly, do not generate keys on the fly, e.g. with key={Math.random()}. This will cause keys to never match up between renders, leading to all your components and DOM being recreated every time. Not only is this slow, but it will also lose any user input inside the list items. Instead, use a stable ID based on the data. Note that your components won’t receive key as a prop. It’s only used as a hint by React itself. If your component needs an ID, you have to pass it as a separate prop: <Profile key={id} userId={id} />. Source: react.dev/learn/rendering-lists @@PhilipFabianek
@mr.duckie._.
@mr.duckie._. 3 ай бұрын
i would build a programming language where null + null = 1, but null * 2 = null
@ramanpreetsingh186
@ramanpreetsingh186 3 ай бұрын
great explanation!!!!
@cusematt23
@cusematt23 3 ай бұрын
These videos are very underrated and underviewed imo ... as someone that tends to get parallelized until i "really get something" ... your videos did a ton for me.
@PhilipFabianek
@PhilipFabianek 3 ай бұрын
Thank you so much!
@js-noob
@js-noob 3 ай бұрын
please create more videos!!!
@js-noob
@js-noob 3 ай бұрын
Please create more videos!!
@user-kn6no9hz4o
@user-kn6no9hz4o 3 ай бұрын
Very usefull and clear video, thank you!
@zGrowthLabs
@zGrowthLabs 3 ай бұрын
incredible explanation!
@mdtanviralam7571
@mdtanviralam7571 3 ай бұрын
Fantastic explanation detailing React Fiber-very helpful! Please continue creating this kind of video content.
@nextleveltech267
@nextleveltech267 3 ай бұрын
Thank you... Really informative 👍
@praveenupadhyay1415
@praveenupadhyay1415 3 ай бұрын
Fabianek You beauty, Although I was knowing some of the concept, but I think when you see this video it just blew me. gonna recommend more and more. ♥♥♥
@prathameshkhetre1494
@prathameshkhetre1494 3 ай бұрын
00:00 Understanding the basics of React 01:50 A React component is a class or function that outputs an element tree. 03:44 React elements, components, and instances 05:42 React uses a virtual DOM to efficiently update the real DOM 07:38 React's Diffing algorithm relies on two important assumptions 09:33 React's reconciliation algorithm explained 11:30 React renderers generate and insert elements during reconciliation. 13:25 React communicates with renderers using dispatchers.
@andrebrandao9451
@andrebrandao9451 3 ай бұрын
What a pity you don't post videos anymore. =(
@PhilipFabianek
@PhilipFabianek 3 ай бұрын
There will be videos in the future, but I am sadly quite busy right now
@zahidshaikh3122
@zahidshaikh3122 4 ай бұрын
Before this, I was working BLINDLY on React and any other library or framework that is out their. This very content opened my EYES 👀.
@omarpervez5657
@omarpervez5657 4 ай бұрын
Have to say bunch of words about this video but not have much time to do it. You did a great job that I can't explain. Keep it up your great work. Have subscribed your Channel 👍
@PhilipFabianek
@PhilipFabianek 4 ай бұрын
Thank you!
@Zaheer__zk40
@Zaheer__zk40 4 ай бұрын
Challenge solution: const inputElement = useRef(); const focusInput = () => { inputElement.current.focus(); }; <input type='text' ref={inputElement} /> <button onClick={focusInput}>Click to focus input</button>
@Zaheer__zk40
@Zaheer__zk40 4 ай бұрын
Challenge solution: const initialColor = { color: 'blue', }; const colorReducer = (state, action) => { if (action.type === 'set') { console.log(action.color); return { ...state, color: action.color, }; } }; const [reducerCounter, dispatch] = useReducer( counterReducer, initialCounterValue ); const [colorGen, colorDispatch] = useReducer(colorReducer, initialColor); const NestedComponent = () => { const { colorGen, colorDispatch } = useContext(ColorContext); const [inputValue, setInputValue] = useState(''); return ( <> <h1 style={{ color: colorGen.color }}>NestedComponent</h1> <input type='text' value={inputValue} onChange={(e) => { setInputValue(e.target.value); }} /> <button onClick={() => { colorDispatch({ type: 'set', color: inputValue, }); }} > Set color </button> </> ); };
@fahim4554
@fahim4554 4 ай бұрын
Great 👍. It helped a lot
@shalin1
@shalin1 4 ай бұрын
Great Video
@Noam-Bahar
@Noam-Bahar 4 ай бұрын
Great video! This really cleared up a lot of misunderstandings I had about React Suspense. Now that it's in a stable version I'll try experimenting with it 🚀
@VarunJain15
@VarunJain15 5 ай бұрын
JavaScript is Not Weird, there is a reason behind it.
@naturalguardian5885
@naturalguardian5885 5 ай бұрын
Awsome work ! keep going this !
@prathameshkhetre1494
@prathameshkhetre1494 5 ай бұрын
crisp and clear, loved the explanation!
@DemystifyFrontend
@DemystifyFrontend 5 ай бұрын
This is really awesome content .
@gnaneshnayak4592
@gnaneshnayak4592 5 ай бұрын
Yes❤
@iShallEatChips
@iShallEatChips 5 ай бұрын
You are a damn smart man!
@MrAdityaSingal
@MrAdityaSingal 5 ай бұрын
Awesome content!!
@mazdysoraya6121
@mazdysoraya6121 5 ай бұрын
Wow thanks.
@vishalkuwar6579
@vishalkuwar6579 6 ай бұрын
wohh what a informative video. Just great!!!!. I dont Know why you stopped making videos but you should make more videos/
@PhilipFabianek
@PhilipFabianek 6 ай бұрын
Thank you, I am currently very busy but there will be videos in the future
@AleySoundz
@AleySoundz 6 ай бұрын
Thank you for this video it was very helpful.
@Ramesh-js
@Ramesh-js 6 ай бұрын
Basically, JSX Can be conveted to React.createElement(... ) By Babel, I''ve written JSX code without importing React! if we see that React imported , then somewhere React.something used !
@Ramesh-js
@Ramesh-js 6 ай бұрын
In order to be converted make sure you have installed babel.
@sgmvideos5175
@sgmvideos5175 6 ай бұрын
what is weird on that object + x is not a number? .1 + .2 = .3000... not just in javascript, it's in any programming language that stores floating point number as 1.X * 2 ^ n typeof NaN (not a number) being a number might seem strange, but it's just part of the object, which other object should it be under? 3 > 2 > 1 also not weird, works like this: 3 > 2 returns true, that is equal to 1, 1 > 1 is false... that is weird just to bad programmers. typeof null being object is same as NaN, null is used when something should return object, but there is nothing to be returned 999... being 100... is the same thing as .1 + .2, javascript stores everything as double hence the moment number is too large, it has to round it the rest is the stuff I watched this for
@PhilipFabianek
@PhilipFabianek 6 ай бұрын
You are of course correct, but you could argue this way for pretty much all things in this video. All of the explanations are available at www.reddit.com/r/learnjavascript/comments/thuc7w/comment/i19vsmp/
@sgmvideos5175
@sgmvideos5175 6 ай бұрын
I was trying to point out mainly the stuff that is not just the javascript stuff, there are 3 main rules in JS that cause all the weird stuff - rule 1 is everything except undefined is object, rule 2 is javascript first tries to do operation on objects themself, if unsucessful, than try to cast, and than throw error, and rule 3 I forgot while I was writing this, but I know there was one more important thing to remember :D
@mrwick2op
@mrwick2op 6 ай бұрын
@mrwick2op
@mrwick2op 6 ай бұрын
Great video , thanks brother it helped alot to understand react better.
@tmanley1985
@tmanley1985 6 ай бұрын
This is amazing content.
@TischenkoPasha
@TischenkoPasha 7 ай бұрын
Thank you! Great professional job done with this videos, wish you all the best!
@StatisticsTheory
@StatisticsTheory 7 ай бұрын
Finally! I've been looking for this series for the past week. Great stuff Philip 😁