Skip to content

Commit 55e736a

Browse files
Clarify prop drilling and introduce Context API (#1510)
* Clarify prop drilling and introduce Context API Refine explanation of prop drilling and introduce Solid's Context API as a solution for managing state across nested components. * ci: apply automated fixes * Update src/routes/(0)concepts/(0)components/(2)props.mdx unpack "cumbersome" with "cluttered and confusing" --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent ff0fe57 commit 55e736a

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

src/routes/(0)concepts/(0)components/(2)props.mdx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,8 @@ function ColoredList(props) {
127127

128128
## Prop drilling
129129

130-
Prop drilling is a term used to describe the process of passing props through multiple layers of components.
131-
While it can be a useful pattern, it can also lead to problems.
132-
When components are nested deeply, passing props through each component can become difficult to manage.
133-
Additionally, this can lead to components receiving props that they do not need, unnecessary re-renders, and trouble refactoring.
134-
135-
Since components in Solid do not own state, props are not needed to pass state between components, but may be used.
136-
Because of this, there may be times when you need to pass props through multiple layers of components.
137-
A common solution to this problem is to use [Context](/concepts/context) to pass state to deeply nested components without having to pass props through each component in between.
130+
Prop drilling refers to passing props through multiple layers of components.
131+
While this is a valid pattern, it can cause props to become cluttered and confusing
132+
in larger component trees, especially when intermediate components receive values they do not directly use.
133+
134+
When multiple components across different levels need access to the same data, Solid’s [Context](/concepts/context) API provides a cleaner alternative. [Context](/concepts/context) allows you to supply values to deeply nested components without manually threading props through each layer.

0 commit comments

Comments
 (0)