React Interview Questions Senior Level (React Fiber, Reconciliation, Virtual DOM)

theSeniorDev
25 Jul 202417:15

Summary

TLDRIn this detailed video, experts explore complex senior React interview questions, focusing on React Fiber and the reconciliation process. They explain how React Fiber improves rendering efficiency by allowing asynchronous updates and pausing during rendering, which contrasts with the traditional synchronous virtual DOM approach. The discussion highlights the importance of prioritizing updates and utilizing the diffing algorithm for efficient UI rendering. The presenters emphasize the need for developers to understand the underlying concepts of React, particularly for those aiming to excel in a competitive job market. The video serves as a valuable resource for deepening React knowledge and interview preparation.

Takeaways

  • πŸ˜€ React Fiber is an intermediate data structure introduced in React 16 that enhances the rendering process by allowing asynchronous updates.
  • πŸ•’ Unlike the traditional virtual DOM, Fiber enables React to pause rendering tasks, improving responsiveness during high-priority updates.
  • πŸ”„ The reconciliation process in React has evolved; Fiber allows for building a Fiber tree to manage updates more efficiently.
  • πŸ“Š The ability to prioritize updates means that user interactions (like typing) can be handled immediately, while less urgent tasks can be paused.
  • πŸ” React's diffing algorithm compares the new virtual DOM with the current one to determine necessary changes before committing to the actual DOM.
  • πŸ—οΈ Stable and unique keys are essential for optimizing React's rendering process, preventing unnecessary updates.
  • 🚦 React's scheduling capabilities allow it to handle low and high-priority updates, leading to a smoother user experience.
  • πŸ“š Developers should focus on mastering JavaScript fundamentals and browser APIs to fully grasp advanced React features.
  • 🧠 Senior React developers are expected to have a deeper understanding of Fiber and its implications for performance.
  • πŸ‘₯ The learning curve for React has increased, and understanding these complex concepts can help developers stand out in a crowded market.

Q & A

  • What is React Fiber and how does it differ from the Virtual DOM?

    -React Fiber is an intermediate structure introduced in React 16 that allows for asynchronous rendering, meaning rendering tasks can be paused and resumed. In contrast, the Virtual DOM is a synchronous process where changes are computed and rendered in one shot.

  • Can you explain the reconciliation process in React?

    -In the reconciliation process, React triggers a re-render of components when a state change occurs. Traditionally, this meant traversing the component tree recursively to render all components in a synchronous manner. With React Fiber, it allows for building a Fiber tree, which can handle updates asynchronously.

  • What are the advantages of using Fiber over the traditional Virtual DOM approach?

    -Fiber allows for prioritized updates, meaning React can pause lower priority rendering tasks in favor of higher priority updates, such as responding to user input, leading to a more responsive UI.

  • How does React manage memory and prevent memory leaks with the Fiber tree?

    -React optimizes memory management by reusing existing Fiber nodes whenever possible. If a component does not change, React retains a reference to the previous Fiber node instead of creating a new one.

  • What is the role of priority updates in React Fiber?

    -Priority updates in React Fiber help to manage rendering based on user interactions. High priority updates, like user input, are processed immediately, while low priority updates, such as fetching data, can be paused and resumed later.

  • What are the key characteristics of the diffing algorithm in React?

    -React's diffing algorithm relies on two main heuristics: if the type of an element changes, all children are discarded and re-rendered, and it assumes keys are stable and unique to optimize rendering by allowing fast comparisons.

  • Why should developers avoid using array indexes as keys in React?

    -Using array indexes as keys can lead to issues with component state management. If an item is removed, the order of elements changes, which can cause React to misidentify components that need re-rendering, leading to unexpected behavior.

  • What browser APIs does React Fiber utilize to enhance rendering performance?

    -React Fiber uses APIs like 'requestIdleCallback' to check if the browser is idle and can perform background rendering, and 'requestAnimationFrame' to commit changes just before the browser repaints the UI.

  • How deep should a developer go in understanding React Fiber and its internals?

    -The depth of understanding depends on the developer's role. Senior React developers should understand the internals to stand out in the job market, while mid-level developers can focus on high-level concepts and the motivations behind React's design.

  • What are the fundamentals a React developer should master to effectively use React?

    -A React developer should strengthen their understanding of JavaScript fundamentals, data structures, and browser APIs. This knowledge forms the foundation for mastering advanced features in frameworks like React.

Outlines

00:00

πŸ˜€ Understanding React Fiber and Virtual DOM

In this section, the speaker discusses the concept of React Fiber, introduced in version 16, which serves as an intermediate structure between React elements and the Virtual DOM. Unlike the traditional synchronous rendering process that can lead to blocking the UI, Fiber allows for asynchronous rendering. This means that React can pause the rendering process to prioritize high-priority updates, making the user experience more fluid. The speaker explains how Fiber builds a tree of components, which helps in reconciling state changes and rendering efficiently. This section also touches on the advantages of Fiber over the Virtual DOM, highlighting the ability to pause and resume rendering operations.

05:01

πŸ˜€ The Reconciliation Process in React

The speaker explains the reconciliation process in React, contrasting traditional methods with the Fiber approach. In the past, state changes triggered a complete re-render of the component tree, leading to potential UI blocking. With Fiber, React constructs a Fiber tree that allows for a more optimized rendering process. This new structure facilitates asynchronous operations and helps avoid memory leaks by reusing Fiber nodes where possible. The discussion emphasizes the importance of prioritizing updates based on user interactions, differentiating between high-priority and low-priority updates, and the implications for UI responsiveness.

10:05

πŸ˜€ React's Diffing Algorithm and Virtual DOM

In this segment, the speaker delves into the diffing algorithm used by React to compare the Virtual DOM with the current DOM. The speaker describes the challenges of tree comparisons and explains how React optimizes this process using heuristics, such as discarding child elements when their type changes and relying on stable keys for fast comparisons. This section highlights the significance of using unique and stable keys in lists to avoid rendering issues. The discussion also touches upon the complexities of React and the knowledge required for developers to navigate these intricacies effectively.

15:07

πŸ˜€ Navigating Complexity as a React Developer

The final part addresses the complexities introduced by React Fiber and the expectations for developers at various levels. The speaker advises that the depth of understanding required depends on the developer's role, suggesting that senior React developers should delve deeper into the internals, while full-stack developers may focus on high-level concepts. The discussion also emphasizes the importance of mastering browser APIs and JavaScript fundamentals as foundational skills for understanding advanced React features. The speaker encourages viewers to strengthen their core knowledge and highlights resources for further learning.

Mindmap

Keywords

πŸ’‘React Fiber

React Fiber is an advanced reconciliation algorithm introduced in React 16 that enhances the rendering capabilities of React applications. Unlike the traditional rendering process, Fiber allows for asynchronous rendering, enabling React to pause and resume rendering tasks based on priority. This capability is particularly important for creating responsive user interfaces, as demonstrated in the video when discussing how high-priority updates, like user interactions, can take precedence over lower-priority tasks.

πŸ’‘Virtual DOM

The Virtual DOM is a lightweight copy of the actual DOM that React uses to optimize updates to the UI. It allows React to perform efficient updates by determining the minimal set of changes required when the state of an application changes. In the script, the Virtual DOM is contrasted with the Fiber tree, illustrating how React uses it primarily for diffing and committing changes to the actual DOM, thereby improving performance.

πŸ’‘Reconciliation

Reconciliation is the process by which React updates the UI to reflect changes in application state. It involves comparing the current Virtual DOM with the new Virtual DOM to identify what has changed. The script explains that traditional reconciliation can block the UI due to its synchronous nature, while the introduction of Fiber allows for a more efficient, asynchronous reconciliation process that improves responsiveness.

πŸ’‘Asynchronous Rendering

Asynchronous rendering refers to the ability of React to pause the rendering of components and resume it later, allowing for smoother user experiences. This is made possible through Fiber, which facilitates a priority queue for managing updates. In the discussion, the importance of handling high-priority updates, such as user inputs, while delaying lower-priority ones, is emphasized to ensure that the user interface remains responsive.

πŸ’‘Priority Queue

A priority queue is a data structure that allows React to manage updates based on their importance. In the context of Fiber, updates are categorized by priority, enabling React to handle urgent user interactions immediately while deferring less critical tasks. The script highlights this concept by explaining how React prioritizes user inputs over data fetching, ensuring a seamless experience.

πŸ’‘Diffing Algorithm

The diffing algorithm is a mechanism that React uses to compare two Virtual DOM trees to determine what changes need to be made to the actual DOM. The algorithm is optimized to minimize the number of operations required to update the UI. In the video, it is noted that this algorithm's efficiency is crucial, especially when dealing with large lists of elements, as it can significantly affect performance.

πŸ’‘Fiber Tree

The Fiber tree is a data structure that represents the components of a React application during the reconciliation process. It contains information about each component's state and props, allowing React to perform incremental updates. The video discusses how the Fiber tree serves as an intermediary between the Virtual DOM and state changes, enabling features like pausing and resuming rendering.

πŸ’‘Memory Management

Memory management in React refers to the strategies used to handle memory usage effectively during rendering and updates. With Fiber, React can optimize memory usage by reusing fiber nodes for components that have not changed. The script mentions that this optimization helps prevent memory leaks and ensures that the application runs smoothly without consuming excessive resources.

πŸ’‘High-Priority Updates

High-priority updates are tasks that require immediate attention from the React rendering engine, such as responding to user interactions like typing or clicking. These updates are processed before lower-priority tasks, ensuring that the UI remains responsive. The interview highlights how Fiber allows React to manage these priorities effectively, improving user experience even when other background processes are occurring.

πŸ’‘Keys in React

Keys are unique identifiers used by React to track elements in a list, enabling efficient updates and re-renders. They play a critical role in the diffing algorithm by helping React determine which elements have changed, been added, or removed. The video underscores the importance of using stable keys to avoid rendering issues, particularly when elements in an array are dynamically modified.

Highlights

Introduction of React Fiber, an intermediate structure that enhances rendering efficiency by allowing asynchronous processing.

Fiber enables the reconciliation process to be paused, allowing React to prioritize higher urgency updates.

Difference between the traditional virtual DOM and Fiber's approach to building the UI tree.

Description of how the reconciliation process traditionally blocked the UI during rendering.

Introduction of the concept of 'low priority' and 'high priority' updates based on user interactions.

React's approach to rendering includes copying the current Fiber tree to manage updates in the background.

Importance of memory management to prevent leaks with the Fiber tree.

Understanding of priority queues and how they enable more fluid user experiences in React applications.

Overview of the diffing algorithm and its efficiency in comparing virtual DOM trees.

Explanation of how keys are used in React to optimize re-renders and avoid inefficiencies.

Advice for developers on how deep their understanding of React should be based on their roles.

Recommendation to start learning about browser APIs that underpin concurrent rendering in React.

Encouragement to strengthen JavaScript fundamentals to better understand advanced React features.

The significance of the React community and resources available for developers looking to deepen their knowledge.

The role of prioritization in React helps maintain a responsive UI, even with complex updates occurring in the background.

Transcripts

play00:00

so today we will answer some of the

play00:02

hardest senior react interview questions

play00:05

our m is cut in real frontend interviews

play00:08

we are going to Deep dive into Concepts

play00:10

such as concurrent react react fiber the

play00:12

reconciliation process and the virtual

play00:14

Dome Bon is going to answer the

play00:17

interview questions but also give you

play00:18

the mental models and the reasons why

play00:21

behind his explanations Bon are you

play00:23

ready yes let's go and let's go with the

play00:26

first question what is react fiber and

play00:29

how is it different

play00:30

from the virtual Dom perfect so I'm

play00:32

going to go ahead and share my screen

play00:33

for this one uh what is react fiber and

play00:36

how is it different from the vual

play00:39

Dom well to put this simply back in the

play00:43

days we had our react elements that

play00:46

would create a virtual Dome node and

play00:49

then that will be translated into an

play00:52

actual Dome node with reconciliation but

play00:54

the problem with this is that it's a

play00:56

very synchronous process that means

play00:58

imagine we have a huge of elements we

play01:01

need to render all those like comput the

play01:03

state and with jsx compute the vual D

play01:06

node all done singly in one shot and

play01:10

then render the D and what react

play01:12

introduced in uh version 16 with react

play01:14

synchronous is the fiber node which is

play01:17

an intermediate structure that gets

play01:20

created and basically all the work of

play01:22

rendering component is done by fiber by

play01:25

this fiber node so just like you had a

play01:27

threee of visual Dom nodes now you have

play01:29

a fiber tree whenever we need to reender

play01:32

we work on this tree we compute the new

play01:33

state we run certain life cycle methods

play01:36

and once we are done we can then compute

play01:38

the V D from the fiber tree and the big

play01:41

advantage of having this structure and

play01:43

the why behind it is that differently

play01:44

from the virtual node and traditional

play01:47

rendering the fiber reconciliation can

play01:49

be paused so we can actually pause you

play01:51

know when we go into the fiber and we

play01:53

have a higher priority update we could

play01:55

actually pause this do something else

play01:56

and then come back to this and that was

play01:58

not possible before for fiber so that

play02:01

would be the big difference where the

play02:02

visual Dome is only used now to actually

play02:05

compute the differences to the Dome and

play02:07

the fiber it's a new intermediate

play02:08

structure that allows us to pause and

play02:12

prioritize the render process to make it

play02:15

asynchronous or what they call concurent

play02:17

react cool Bon um this leads me to our

play02:20

second question today which is can you

play02:22

explain the reconciliation process in

play02:25

react and also if you can tell me what

play02:27

does the introduction of react fiber

play02:29

mean means for the reconciliation

play02:31

process as well so in the reconciliation

play02:33

in traditional reconciliation we had our

play02:36

component it will trigger a state change

play02:39

and that will trigger a reender of the

play02:41

component three and rendering means we

play02:43

would go from the root node the root

play02:45

component all the way to the children

play02:47

all the way to what we call the leaf

play02:49

noes the very bottom components and run

play02:51

the render function recursively and we

play02:53

would put that in the call stack so all

play02:56

these things will be into the call stack

play02:58

all the way to the bottom then we will

play02:59

would execute them and finally from that

play03:02

we would extract the new virtual Dom

play03:03

that's what they call the stack Recon

play03:05

shizer and this one it's kind of

play03:08

synchronous in the sense of imagine we

play03:09

have a huge component Tre we would need

play03:11

to put recursively all those render

play03:13

functions in here finish them and then

play03:16

finally render when we have a huge

play03:18

component threee you might have what we

play03:20

call a blocking UI imagine we're

play03:21

fetching some data and rendering things

play03:24

on the screen if you are completing a

play03:25

form at the same time as a user you

play03:28

would perceive that form as

play03:29

non-responsive Ive because the cold

play03:30

stack is busy by rendering this

play03:33

components that are being fetched and so

play03:35

we can't really reender for example the

play03:37

UI the browser cannot repaint so maybe

play03:40

you're typing in an input field but you

play03:41

don't see anything happening so that was

play03:44

kind of the old reconation process and

play03:46

after that we had our vome we would make

play03:49

our diffing algorithm and finally commit

play03:51

to the Dome the changes needed that was

play03:54

uh how react used to work with fiber

play03:57

things are a bit more complex so

play04:00

what react does is from the component

play04:02

tree it will build what we call fiber

play04:04

tree and a fiber is nothing but let me

play04:07

zoom in I think I have a fiber around

play04:09

here it's a JavaScript object and inside

play04:12

there's many properties but probably the

play04:14

most important are the state and the new

play04:16

props right the props the component has

play04:18

the memorized props everything you need

play04:20

about the component the function that

play04:22

runs it the siblings and the child are

play04:24

all here and so react will create a

play04:26

fiber tree with this internally right

play04:29

and it will run the render function for

play04:31

all the for that fiber tree and from it

play04:34

it will deduct the virual D and then the

play04:37

process is just like before the virual

play04:38

do gets compared with our ding algorithm

play04:41

and we commit changes to the do so far

play04:44

nothing changed but we have this

play04:46

intermediate

play04:47

step nice now what I still don't

play04:50

understand B is right now we have the

play04:53

fiber tree right as a in in between the

play04:56

ritual Dome and the state changes and

play04:59

I'm wondering why why the fiber why do I

play05:01

need fiber in the first place right

play05:02

because it adds extra complexity and I'm

play05:04

wondering what does fiber allows me to

play05:07

do that the vual Dom couldn't you you

play05:09

mentioned this a synchronous rendering

play05:12

right could you expand a bit on that

play05:14

because it feels to me like it's it's

play05:15

adding a lot of complexity react was

play05:17

already complex the diffing algorithm

play05:19

was already complex and now we have a

play05:20

stage in between that's kind of

play05:22

definitely adding another layer of

play05:24

abstraction of complexity um is it white

play05:27

it do we really need why and why do we

play05:28

really need this step

play05:30

this 5

play05:31

by3 yeah very very good question so what

play05:34

the f by3 allows us to do is that it

play05:37

works together with a priority queue and

play05:39

a scheduler and rather than having this

play05:42

process synchronous like we really like

play05:44

as I explained before about the the

play05:46

stack reconciliatory we would go like

play05:48

have to run the whole render in one shot

play05:51

we can actually pause we can actually

play05:53

stop at a certain node pause and do

play05:56

something else and then come back to

play05:58

this render the way that's done and I'm

play06:00

going to try to explain it really

play06:02

quickly is that whenever a an update um

play06:05

let's say imagine a set State happens an

play06:07

update gets attached to this 5 by3 so

play06:10

let's imagine there's a state change

play06:11

here for this form component there is an

play06:13

update queue for this form component and

play06:15

that change that will be cued there and

play06:18

what react will do after that is to copy

play06:21

the current fiber tree in the background

play06:23

and do work on it that means just go

play06:26

through each node and see if there's any

play06:29

update and compute the new memo State

play06:32

and run the render method but it does

play06:34

all this in the background and so that

play06:37

means while react does all this right

play06:40

imagine we have a huge component um it

play06:43

can actually it does it asynchronously

play06:45

it doesn't take all the main thread to

play06:48

do this basically what react does is it

play06:50

goes to our main thread to the web

play06:54

browser and calls this function which is

play06:57

uh I do not have it here but it's called

play06:59

request eedle call back which basically

play07:01

it tells the browser hey um do you have

play07:03

some free time are you eidle and the

play07:05

browser says yes I am eidle and I will

play07:08

let you do some work for around 50

play07:10

milliseconds that's the default in the

play07:12

browser and then react goes and starts

play07:14

doing this work right tick tick TI it

play07:17

doesn't need to finish yeah it will just

play07:19

do some work when react finished the the

play07:21

frame budget we call it that way like

play07:23

the browser says okay you've done enough

play07:26

but now I need to free the main thread

play07:28

to repaint or reender the UI then rect

play07:31

will pause everything and this was

play07:33

impossible before you really needed to

play07:35

finish the render before doing anything

play07:38

else one follow-up question that comes

play07:39

to my mind is how can we manage all this

play07:41

in memory I mean how can we prevent

play07:43

memory leaks the whole fiber Tre will

play07:46

basically stay somewhere in memory and

play07:48

we're kind of adding changes to those

play07:50

and how can we make sure nothing nothing

play07:52

goes wrong so what Rea does really well

play07:54

is to reuse a lot of the fiberry so you

play07:57

see when we create this new working prog

play07:59

that we are rendering um a lot of these

play08:02

nodes are copied especially if react see

play08:04

that they didn't change so if imagine

play08:07

one of those fiber uses the use memo

play08:10

hook or the react. memo and the props

play08:13

didn't change react will not reender it

play08:15

will just maintain a reference to the

play08:17

previous one so it's very optimized and

play08:20

it tries to reuse as much as possible of

play08:23

the previous fiber Tre mhm understood

play08:26

understood so it's it's kind of prepared

play08:28

for that to be as if ient as possible

play08:30

and and not not use too many resources

play08:32

you mentioned a high priority update how

play08:35

how does that work what what do you mean

play08:37

by that what I mean is that imagine we

play08:39

are fetching some data and rendering a

play08:42

huge list of elements that would be a

play08:43

low priority update because it's it's

play08:46

nothing that we need to instantaneously

play08:48

show to the user whereas whenever the

play08:51

user is typing something on an input

play08:52

field and we want to show a focus or an

play08:55

outline on that input field or even an

play08:57

error message we want to react to user

play08:59

input input then yes that will be a much

play09:01

higher priority update so react will

play09:04

pause this low priority render it will

play09:07

create a new working progress three for

play09:09

the high priority um update finish that

play09:13

one commit like compute the virtual Dome

play09:17

and commit the changes to the Dom and

play09:19

then go back to the low priority update

play09:21

that's why it's called concurrent react

play09:23

or synchronous react because you can

play09:25

actually use a priority queue to under

play09:28

the hood prioritize those updates so for

play09:30

the end user even if we're doing a lot

play09:33

of background work the UI feels a lot

play09:35

more fluid here's basically the list of

play09:38

internal priorities that the react

play09:40

developers added to the framework the

play09:41

top priority would be a discret event

play09:43

like if they click or they type on an

play09:44

import the second one would be if they

play09:46

scroll and we need to show something on

play09:48

screen because the user scrolled a

play09:49

normal priority would be something like

play09:51

data Fetch and a very low priority would

play09:53

be a route change for example and all

play09:55

this is internal to the react codebase

play09:57

we don't need to worry about it but it's

play09:59

important for us to know that this is

play10:01

how react handles now um reenders in

play10:04

updates that's quite a bit of complexity

play10:07

out would say for the average react

play10:08

developer and I have a follow-up

play10:09

question prepared uh but first let's

play10:11

answer the third question that I had uh

play10:14

prepared here which is what can you tell

play10:16

me about the diffing algorithm and the

play10:18

virtual D so as I mentioned this render

play10:21

process it's it can be paused and as

play10:22

synchronous but whenever we finish this

play10:25

we have a synchronous phase which is the

play10:27

commit phase which is I know what Chang

play10:29

I need to do and now I'm going to commit

play10:31

them to push them to the actual Dom so

play10:35

what we do is once we have each fiber

play10:38

tree um finished and we have the memory

play10:41

State we can compute the Von the new

play10:44

virtual Dome this didn't change much

play10:46

with previous react we will compare the

play10:48

vome the new one with the current fatal

play10:51

Dome and try to figure out the

play10:52

differences now traditionally comparing

play10:55

to trees like that would take I think

play10:58

the big o for this would be n to the

play11:01

thir so n n by n by n n being the number

play11:05

of elements so imagine we have a

play11:07

thousand elements it will take a billion

play11:09

operations to actually compare those

play11:11

threes wow so yeah so react has two her

play11:14

istics uh which is it basically assumes

play11:17

that if the type of an element change so

play11:20

if this form is not a form anymore then

play11:23

it will discard all the children and try

play11:24

to recompute that so because that's a

play11:27

lot cheaper like rendering that from

play11:29

scratch is a lot cheaper than comparing

play11:30

everything so that's the first one which

play11:33

is you know if different type then redo

play11:37

and the second one is assume

play11:40

key are stable uh I'll get in a second

play11:44

into keys they they're stable and unique

play11:46

so whenever we have a list of elements

play11:51

we react will ask for that key prop and

play11:54

it will use that to actually really fast

play11:57

compare those elements if our keys has

play11:59

are not stable that means they change

play12:00

values all the time we're pushing a lot

play12:02

of new work um and if they're not unique

play12:04

react won't be really able to use them

play12:07

because it really tries to identify a

play12:09

leaf tree with a key so imagine here we'

play12:12

have um 15 inputs it would use that key

play12:16

to differentiate which ones do I need to

play12:17

reender which ones I don't have this is

play12:19

why for example you should never use

play12:22

array indexes as keys in a component

play12:27

because they're not stable right exactly

play12:29

because if you delete an element in in

play12:32

position five of the array all the

play12:34

others will shift and all of a sudden

play12:36

maybe react doesn't reender element

play12:38

number six even if the actual content or

play12:40

the underlying state has changed so

play12:43

these are the tra of her istic and you

play12:44

need to know this as a developer in

play12:46

order to really avoid having weird

play12:49

issues so of course I have a followup

play12:52

question prepared for that but I just

play12:53

wanted to take a break and for everyone

play12:56

watching last you're probably watching

play12:58

this video because you interviewing

play12:59

right now and I guess you are a

play13:01

JavaScript engineer whether it's know

play13:02

front end with react or frontend general

play13:05

full stack even backend develop right

play13:07

now then we have a present for you so we

play13:10

prepared a free technal assessment for

play13:12

you to understand what your technal gaps

play13:15

are and to also adjust your interviewing

play13:17

process and try to fix those gaps for

play13:19

you to perform in your next teal

play13:20

interview it's available for free in the

play13:22

comments the link is going to be there

play13:24

and you can go to the C website and take

play13:26

it um and I wish you the best of luck we

play13:29

that being said my my you know my big

play13:31

question right now B is after seeing all

play13:32

this stuff I mean react was already you

play13:36

know the learning curve was quite Steep

play13:38

and the framework itself is BEC becoming

play13:40

pretty complex I mean you you spent a

play13:42

few hours to have this kind of thinkal

play13:44

depth this knowledge is also not readily

play13:46

available online so you have to kind of

play13:48

dig deeper into the the source code the

play13:50

documentation so my the million dollar

play13:52

question is much how deep should a the

play13:55

average you know re developer go how

play13:57

much should a mid level developer know

play13:59

how much should I react engineer know I

play14:01

guess to answer that it very much

play14:02

depends of what kind of developer you

play14:04

are if you are a senior full stack

play14:06

developer a bit more spread out you

play14:08

cannot really spend so much time in

play14:10

react and so I would just learn maybe

play14:12

the motivation of the reac team behind

play14:14

it and a top level API but if you are a

play14:17

senior react developer what we have seen

play14:20

in the market is that it did became a

play14:23

bit more overcrowed than it used to be

play14:25

and so this level of technical depth

play14:27

I'll talk daunting it will get help you

play14:29

stand out in in the uh in an already

play14:31

overcrowed market and the good news I

play14:33

have for everybody else is that the data

play14:36

structures that are being used like qes

play14:38

and priority hips and trees they will

play14:41

develop your thinking model and your

play14:43

language and so you don't really lose by

play14:45

going this deep if you're a senior react

play14:46

developer I think you will have to go

play14:48

pretty deep into it because this is your

play14:50

thing you are a senior react developer

play14:52

if you're a senior frent developer also

play14:55

but if you're a senior for stack I would

play14:57

just look at the top level ideas behind

play14:59

it and try to understand the motivation

play15:01

of the reacting behind it you will not

play15:04

have to interact with the fiber directly

play15:06

at any point as a developer so there's

play15:09

no need to go too deep into it and if

play15:12

you're a react developer trying to

play15:14

deepen your knowledge in about react

play15:16

internal staring to learn more about

play15:17

fiber 3 where would you start I would

play15:20

start with the browser apis there are

play15:22

two main functions that they built

play15:24

concurent react around which is request

play15:27

e callback which is hey the browser is

play15:30

free and says you can give me some work

play15:32

to do I will do it in the background and

play15:35

that's when react starts rendering and I

play15:37

think the other one was request

play15:38

animation frame which is the browser

play15:40

saying I'm going to repaint and rerender

play15:42

the UI is there anything really quickly

play15:44

that you want me to do before and that's

play15:46

when react commits changes to the Dom

play15:48

high priority changes so you see them in

play15:51

the next refresh in the next repaint if

play15:53

you learn those first of all you can use

play15:55

them in other Frameworks and then you'll

play15:57

realize that everything they built into

play15:59

fiber was to be able to use these apis

play16:01

in a concurrent mode and that's why they

play16:03

added a priority cue to it and and the

play16:06

whole fiber thing so I would start there

play16:08

which is why folks and for the people

play16:10

watching us you will see this across the

play16:11

whole sentive Channel and across

play16:14

everything we do but fundamentals are

play16:16

the way to go right because as you can

play16:17

see whatever Frameworks are trying to

play16:20

build upon it's always upon basic

play16:22

browser functionality and JavaScript

play16:25

fundamentals right uh we talked about

play16:27

basic data structures without we about

play16:29

the call stack and as you can see when

play16:30

Bon was actually explaining and going

play16:32

through the fiber explanations he did a

play16:34

a complexity analysis he was always

play16:36

referring to data structures that are

play16:38

agnostic and to JavaScript

play16:41

characteristics that are built into the

play16:42

language so if you're really funny

play16:44

enough if you really want to master the

play16:46

advanced features of a framework like

play16:48

react you actually need to master and

play16:50

strengthen your fundamentals first if

play16:52

you're interested into strengthening

play16:54

your fundamentals then you're in the

play16:55

right place make sure you subscribe to

play16:57

the channel let us know in the comments

play16:59

if there's any other advanc re question

play17:01

senior level question that you want b i

play17:04

to cover or if there's anything in this

play17:05

video that you want us to go deeper in

play17:07

into and we expect a lot more videos

play17:10

like this coming your way ban thank you

play17:12

so much and we will see you folks in the

play17:14

next one

Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
React ConceptsInterview PreparationFrontend DevelopmentJavaScript SkillsTechnical KnowledgeReact FiberReconciliation ProcessCoding InterviewsWeb DevelopmentConcurrency