You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
? 'React is the library for web and native user interfaces. Build user interfaces out of individual pieces called components written in JavaScript. React is designed to let you seamlessly combine components written by independent people, teams, and organizations.'
58
+
: 'The library for web and native user interfaces';
Copy file name to clipboardexpand all lines: src/content/blog/2023/03/22/react-labs-what-we-have-been-working-on-march-2023.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -74,7 +74,7 @@ Making plain JavaScript in React components reactive requires a compiler with a
74
74
75
75
## Offscreen Rendering {/*offscreen-rendering*/}
76
76
77
-
Offscreen rendering is an upcoming capability in React for rendering screens in the background without additional performance overhead. You can think of it as a version of the [`content-visiblity` CSS property](https://developer.mozilla.org/en-US/docs/Web/CSS/content-visibility) that works not only for DOM elements but React components, too. During our research, we've discovered a variety of use cases:
77
+
Offscreen rendering is an upcoming capability in React for rendering screens in the background without additional performance overhead. You can think of it as a version of the [`content-visibility` CSS property](https://developer.mozilla.org/en-US/docs/Web/CSS/content-visibility) that works not only for DOM elements but React components, too. During our research, we've discovered a variety of use cases:
78
78
79
79
- A router can prerender screens in the background so that when a user navigates to them, they're instantly available.
80
80
- A tab switching component can preserve the state of hidden tabs, so the user can switch between them without losing their progress.
Copy file name to clipboardexpand all lines: src/content/learn/describing-the-ui.md
+10-2
Original file line number
Diff line number
Diff line change
@@ -530,13 +530,21 @@ React uses trees to model the relationships between components and modules.
530
530
531
531
A React render tree is a representation of the parent and child relationship between components.
532
532
533
-
<Diagramname="generic_render_tree"height={250}width={500}alt="A tree graph with five nodes, with each node representing a component. The root node is located at the top the tree graph and is labelled 'Root Component'. It has two arrows extending down to two nodes labelled 'Component A' and 'Component C'. Each of the arrows is labelled with 'renders'. 'Component A' has a single 'renders' arrow to a node labelled 'Component B'. 'Component C' has a single 'renders' arrow to a node labelled 'Component D'.">An example React render tree.</Diagram>
533
+
<Diagramname="generic_render_tree"height={250}width={500}alt="A tree graph with five nodes, with each node representing a component. The root node is located at the top the tree graph and is labelled 'Root Component'. It has two arrows extending down to two nodes labelled 'Component A' and 'Component C'. Each of the arrows is labelled with 'renders'. 'Component A' has a single 'renders' arrow to a node labelled 'Component B'. 'Component C' has a single 'renders' arrow to a node labelled 'Component D'.">
534
+
535
+
An example React render tree.
536
+
537
+
</Diagram>
534
538
535
539
Components near the top of the tree, near the root component, are considered top-level components. Components with no child components are leaf components. This categorization of components is useful for understanding data flow and rendering performance.
536
540
537
541
Modelling the relationship between JavaScript modules is another useful way to understand your app. We refer to it as a module dependency tree.
538
542
539
-
<Diagramname="generic_dependency_tree"height={250}width={500}alt="A tree graph with five nodes. Each node represents a JavaScript module. The top-most node is labelled 'RootModule.js'. It has three arrows extending to the nodes: 'ModuleA.js', 'ModuleB.js', and 'ModuleC.js'. Each arrow is labelled as 'imports'. 'ModuleC.js' node has a single 'imports' arrow that points to a node labelled 'ModuleD.js'.">An example module dependency tree.</Diagram>
543
+
<Diagramname="generic_dependency_tree"height={250}width={500}alt="A tree graph with five nodes. Each node represents a JavaScript module. The top-most node is labelled 'RootModule.js'. It has three arrows extending to the nodes: 'ModuleA.js', 'ModuleB.js', and 'ModuleC.js'. Each arrow is labelled as 'imports'. 'ModuleC.js' node has a single 'imports' arrow that points to a node labelled 'ModuleD.js'.">
544
+
545
+
An example module dependency tree.
546
+
547
+
</Diagram>
540
548
541
549
A dependency tree is often used by build tools to bundle all the relevant JavaScript code for the client to download and render. A large bundle size regresses user experience for React apps. Understanding the module dependency tree is helpful to debug such issues.
Copy file name to clipboardexpand all lines: src/content/learn/passing-data-deeply-with-context.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -985,7 +985,7 @@ export const places = [{
985
985
}, {
986
986
id:5,
987
987
name:'Chefchaouen, Marocco',
988
-
description:'There are a few theories on why the houses are painted blue, including that the color repells mosquitos or that it symbolizes sky and heaven.',
988
+
description:'There are a few theories on why the houses are painted blue, including that the color repels mosquitos or that it symbolizes sky and heaven.',
989
989
imageId:'rTqKo46'
990
990
}, {
991
991
id:6,
@@ -1124,7 +1124,7 @@ export const places = [{
1124
1124
}, {
1125
1125
id:5,
1126
1126
name:'Chefchaouen, Marocco',
1127
-
description:'There are a few theories on why the houses are painted blue, including that the color repells mosquitos or that it symbolizes sky and heaven.',
1127
+
description:'There are a few theories on why the houses are painted blue, including that the color repels mosquitos or that it symbolizes sky and heaven.',
Copy file name to clipboardexpand all lines: src/content/learn/understanding-your-ui-as-a-tree.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -253,7 +253,7 @@ With conditional rendering, across different renders, the render tree may render
253
253
254
254
In this example, depending on what `inspiration.type` is, we may render `<FancyText>` or `<Color>`. The render tree may be different for each render pass.
255
255
256
-
Although render trees may differ across render pases, these trees are generally helpful for identifying what the top-level and leaf components are in a React app. Top-level components are the components nearest to the root component and affect the rendering performance of all the components beneath them and often contain the most complexity. Leaf components are near the bottom of the tree and have no child components and are often frequently re-rendered.
256
+
Although render trees may differ across render passes, these trees are generally helpful for identifying what the *top-level* and *leaf components* are in a React app. Top-level components are the components nearest to the root component and affect the rendering performance of all the components beneath them and often contain the most complexity. Leaf components are near the bottom of the tree and have no child components and are often frequently re-rendered.
257
257
258
258
Identifying these categories of components are useful for understanding data flow and performance of your app.
0 commit comments