Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(CustomProvider): add PREVIEW_components prop #2493

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

SevenOutman
Copy link
Member

@SevenOutman SevenOutman commented May 19, 2022

Override component defaults via <CustomProvider>

Override components' defaultProps.

<CustomProvider
  PREVIEW_components={{
    Message: {
      defaultProps: {
        type: 'success'
      }
    }
  }}
>
  <Message>This is a success message</Message>
</CustomProvider>

Preview APIs

Since this feature is relatively big, I'd like to introduce this new prop with a PREVIEW_ prefix, indicating that it's still under development as not all components supports it so far. The prefix will be removed once it's ready to ship it as a stable feature.

Supported components

  • Button
  • Message

@vercel
Copy link

vercel bot commented May 19, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
rsuite-nextjs ✅ Ready (Inspect) Visit Preview Jun 8, 2022 at 9:31AM (UTC)
1 Ignored Deployment
Name Status Preview Updated
rsuite-v4 ⬜️ Ignored (Inspect) Jun 8, 2022 at 9:31AM (UTC)

@codesandbox-ci
Copy link

codesandbox-ci bot commented May 19, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit b289091:

Sandbox Source
rsuite-tp-ci Configuration

@codecov
Copy link

codecov bot commented May 19, 2022

Codecov Report

Merging #2493 (b289091) into main (3926189) will increase coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #2493      +/-   ##
==========================================
+ Coverage   85.28%   85.31%   +0.03%     
==========================================
  Files         293      294       +1     
  Lines        9084     9090       +6     
  Branches     2552     2554       +2     
==========================================
+ Hits         7747     7755       +8     
+ Misses        701      700       -1     
+ Partials      636      635       -1     
Flag Coverage Δ
ChromeCi 85.29% <100.00%> (+<0.01%) ⬆️
Firefox 85.29% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/CustomProvider/CustomProvider.tsx 100.00% <ø> (ø)
src/Button/Button.tsx 95.23% <100.00%> (ø)
src/CustomProvider/useProps.ts 100.00% <100.00%> (ø)
src/Message/Message.tsx 85.18% <100.00%> (ø)
src/utils/useRootClose.ts 84.00% <0.00%> (+8.00%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3926189...b289091. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant