Skip to content
This repository was archived by the owner on Jan 19, 2025. It is now read-only.

Commit 0e076c2

Browse files
committed
Fix typos 🚀
1 parent 88a5cf7 commit 0e076c2

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/posts/2025-01-03-styled-component-transient-props-type-mapped-type-typescript.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ The `StyledOverlay` component receive all the props of the container component,
5151

5252
* avoid the forward for `zIndex` and `delay` because they are not DOM attributes.
5353
This is why they are contained again in the `StyledOverlayProps` interface with the `$` transient prop prefix.
54-
* forward the `onClick` prop to the underling DOM element (and so we don't add the property to the `StyledOverlayProps` but
55-
we still pass it to the component).
54+
* forward the `onClick` prop to the underling DOM element (and so we don't add the property to the `StyledOverlayProps` but we still pass it to the component).
5655

5756
```tsx
5857
interface StyledOverlayProps {
@@ -149,13 +148,12 @@ Now we are ready to create the `TransientProps` type.
149148
This type receives two generic parameters:
150149

151150
* the `CustomProps` interface for which we want to remap the properties as transient ones.
152-
* the `IntrinsicElements` if needed to get the type of the underlying dome element. If not passed it will have a default `false` value and all the props will become transient.
151+
* the `IntrinsicElements` if needed to get the type of the underlying DOM element. If not passed it will have a default `false` value and all the props will become transient.
153152

154153
This type will use TypeScript mapped types to remap the properties of `CustomProps` received.
155154
The utility types created before are used to conditionally filter out DOM properties if needed.
156155
We can add our utility type to the `styled-components` module.
157-
In this way,
158-
thanks to [module augmentation](https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation),
156+
In this way, thanks to [module augmentation](https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation),
159157
we will have the `TransientProps` type exposed as it is a type from the framework itself.
160158

161159
```typescript

0 commit comments

Comments
 (0)