Update adr006 on using PropsWithChildren

This commit is contained in:
Oliver Sand
2021-01-19 10:36:27 +01:00
parent 26fc0aeb2e
commit 61abb1a500
@@ -43,6 +43,15 @@ const GoodComponent = ({ text, children }: GoodProps) => (
{children}
</div>
);
/* Or as a shorthand, if no specifc child type is required */
type GoodProps = PropsWithChildren<{ text: string }>;
const GoodComponent = ({ text, children }: GoodProps) => (
<div>
<div>{text}</div>
{children}
</div>
);
```
## Consequences