Merge pull request #4142 from SDA-SE/feat/update-adr006

Update adr006 on using PropsWithChildren
This commit is contained in:
Patrik Oldsberg
2021-01-20 19:36:11 +01:00
committed by GitHub
@@ -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