Skip to content
This repository was archived by the owner on Aug 21, 2023. It is now read-only.

Conversation

@ItsJonQ
Copy link
Contributor

@ItsJonQ ItsJonQ commented Sep 4, 2017

Improve component props

Export propTypes

From now on, the const propTypes being declared on components will be made available to be imported. This allows for easier propType re-use! All of Blue's components were updated to support this.

Making component props more flexible

With the rare exception of certain components (like Portal), most of Blue's components have been updated to accept additional props beyond the defaultPropts by using the {...rest} style method. The typical use-case would be to easily add custom style options, or perhaps id or data- properties.

Example
<Avatar style={{ padding: 20 }} />

No changes/updates are required for the user/consumer!

These updates should work with existing integrations. 🚀

ItsJonQ added 2 commits September 4, 2017 16:40
**Export propTypes**

From now on, the const `propTypes` being declared on components will be made available to be imported. This allows for easier propType re-use! All of Blue's components were updated to support this.

**Making component props more flexible**

With the rare exception of certain components (like `Portal`), most of Blue's components have been updated to accept additional props beyond the defaultPropts by using the `{...rest}` style method. The typical use-case would be to easily add custom `style` options, or perhaps `id` or `data-` properties.

**Example**

```jsx
<Avatar style={{ padding: 20 }} />
```

No changes/updates are required for the user/consumer!

These updates should work with existing integrations. 🚀
@ItsJonQ ItsJonQ self-assigned this Sep 4, 2017
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling b150c64 on improve-component-props into cf5f567 on master.

@ItsJonQ ItsJonQ merged commit 78f09fd into master Sep 4, 2017
@ItsJonQ ItsJonQ deleted the improve-component-props branch September 4, 2017 21:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants