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
The <strong>Context API</strong> is a React feature that enables you to share values (like global settings, user auth, or themes) between components without having to explicitly pass a prop through every level of the tree.
Copy file name to clipboardExpand all lines: src/data/vocab/pluribus.js
+4-5Lines changed: 4 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,7 @@
1
1
importReactfrom'react';
2
2
3
-
exportdefault{
4
-
title: 'Pluribus',
5
-
content: (
3
+
exportdefaultfunctionPluribus(){
4
+
return(
6
5
<divclassName="space-y-4">
7
6
<p>
8
7
<strong>Pluribus</strong> is Latin for "from many" or "more". It is most famously known as part of the United States motto <em>E pluribus unum</em> ("Out of many, one").
Copy file name to clipboardExpand all lines: src/data/vocab/prop-drilling.js
+4-5Lines changed: 4 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,7 @@
1
1
importReactfrom'react';
2
2
3
-
exportdefault{
4
-
title: 'Prop Drilling',
5
-
content: (
3
+
exportdefaultfunctionPropDrilling(){
4
+
return(
6
5
<divclassName="space-y-4">
7
6
<p>
8
7
<strong>Prop Drilling</strong> (also known as "threading") refers to the process of passing data from a parent component down to a deeply nested child component through intermediate components that do not need the data themselves.
@@ -29,5 +28,5 @@ export default {
29
28
<strong>Solution:</strong> Use the <em>Context API</em>, <em>Redux</em>, or similar state management libraries to make data accessible to any component in the tree without manual passing.
0 commit comments