segmentio / evergreen

🌲 Evergreen React UI Framework by Segment
https://evergreen.segment.com
MIT License
12.38k stars 830 forks source link

fix: `toaster` types #1616

Closed filippofilip95 closed 1 year ago

filippofilip95 commented 1 year ago

Hello ! :)

Overview This PR fixes the Typescript type of the toaster instance in the following way:

  1. Retype title argument in toaster. The title was typed as only a string but instead, it can support ReactNode. Type ReactNode is for title also specified in interface Toast.
  2. Add function remove to the toaster. Function remove is exposed in the toaster however it doesn't exist in types. Function remove is also already used in the storybook here.

Screenshots (if applicable) Documentation doesn't need a change since it's already considering that type title is a node.

Screenshot 2023-02-09 at 10 40 03

Documentation

netlify[bot] commented 1 year ago

Deploy Preview for evergreen-storybook ready!

Name Link
Latest commit 9048925694ee8a6bcc1029a9db427fa11b33e44d
Latest deploy log https://app.netlify.com/sites/evergreen-storybook/deploys/63ecc4b27153890008c37a70
Deploy Preview https://deploy-preview-1616--evergreen-storybook.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

brandongregoryscott commented 1 year ago

Thanks for the contribution, @filippofilip95! This should be fixed in https://github.com/segmentio/evergreen/releases/tag/v7.1.4