---
title: "Comment by shadowtime2000 on \"An easier way to add types for \"children\" in React\" | Hashnode"
description: "You could also do import type { PropsWithChildren } from &quot;react&quot; ; because it&#39;s easier for build tools to know it&#39;s a type import so they can"
url: "https://hashnode.com/posts/props-with-children-react-typescript/6042741891eeac2b7aee83ba/comment/6042e05991eeac2b7aee885f"
---

[Discussion](https://hashnode.com/posts/props-with-children-react-typescript/6042741891eeac2b7aee83ba)

Comment [An easier way to add types for "children" in React](https://hashnode.com/posts/props-with-children-react-typescript/6042741891eeac2b7aee83ba)

[shadowtime2000](https://hashnode.com/@shadowtime2000)

[Mar 6, 2021](https://hashnode.com/posts/props-with-children-react-typescript/6042741891eeac2b7aee83ba/comment/6042e05991eeac2b7aee885f)

You could also do

```
import type { PropsWithChildren } from "react";
```

because it's easier for build tools to know it's a type import so they can remove it without ruining the output of the code.

[Ozzie Neher](https://hashnode.com/@ozziexsh)

[Mar 6, 2021](https://hashnode.com/posts/props-with-children-react-typescript/6042741891eeac2b7aee83ba/comment/6042e05991eeac2b7aee885f#reply-6043afc95a56f82fa3ecbef7)

Interesting! I'd never heard of `import type` until your comment. The more ya know!

[typescriptlang.org/docs/handbook/release-notes/ty…](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export)
