---
title: "Comment by Saša Šijak on \"A neat way of building React components\" | Hashnode"
description: "For me it is much cleaner to do it like this: size : &quot;sm&quot; | &quot;md&quot; | &quot;lg&quot; That way you do not have to import Sizes type everywhere a"
url: "https://hashnode.com/posts/a-neat-way-of-building-react-components/60229875aaa3543c903bfbc9/comment/6024e3a14d9e7d4dd727e022"
---

[Discussion](https://hashnode.com/posts/a-neat-way-of-building-react-components/60229875aaa3543c903bfbc9)

Comment [A neat way of building React components](https://hashnode.com/posts/a-neat-way-of-building-react-components/60229875aaa3543c903bfbc9)

[Saša Šijak](https://hashnode.com/@ssijak)

[Feb 11, 2021](https://hashnode.com/posts/a-neat-way-of-building-react-components/60229875aaa3543c903bfbc9/comment/6024e3a14d9e7d4dd727e022)

For me it is much cleaner to do it like this:

```
size: "sm" | "md" | "lg"
```

That way you do not have to import `Sizes` type everywhere and type it in each prop and you still get type check

[Telmo Goncalves](https://hashnode.com/@telmo)

[Feb 11, 2021](https://hashnode.com/posts/a-neat-way-of-building-react-components/60229875aaa3543c903bfbc9/comment/6024e3a14d9e7d4dd727e022#reply-6024ec6e8a18494dfcecc047)

The only reason I would disagree with this is, lets picture you're using `<Button size="md">` is hundreds of places in your app. Now, you get a requirement to change it from `md` to `medium`.

With the `enum` you only need to change it in the `Button` component itself, you don't need to go over every single scenario where you're using it and change to `medium`.
