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

fix: CodePreview - show explicit false props #985

Merged
merged 1 commit into from
Sep 22, 2023
Merged

fix: CodePreview - show explicit false props #985

merged 1 commit into from
Sep 22, 2023

Conversation

SutuSebastian
Copy link
Collaborator

If the setting useBooleanShorthandSyntax is not set to false in the https://github.com/algolia/react-element-to-jsx-string/tree/master options object, it will remove for good any prop looking like this prop={false}, even tho the default is set to true within the component.

This is a problem because it can misguide people when they look at the code snippet, if they copy it and paste it -> they should see the same results, which today is not the case, for example for https://www.flowbite-react.com/docs/components/datepicker#autohide.

Changes

  • show explicit false props (eg: visible={false})
  • removing sortProps since it defaults to true

This issue currently affects the following components:

  1. avatar
  2. carousel
  3. datepicker
  4. dropdown
  5. rating
  6. tooltip

MDX source code

Screenshot 2023-09-22 at 16 07 28

Before

Screenshot 2023-09-22 at 14 47 21

After

Screenshot 2023-09-22 at 16 06 09

@vercel
Copy link

vercel bot commented Sep 22, 2023

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

Name Status Preview Comments Updated (UTC)
flowbite-react ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 22, 2023 1:47pm

@codecov
Copy link

codecov bot commented Sep 22, 2023

Codecov Report

Patch coverage: 71.69% and project coverage change: -6.03% ⚠️

Comparison is base (7461173) 99.54% compared to head (a31a991) 93.52%.
Report is 85 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #985      +/-   ##
==========================================
- Coverage   99.54%   93.52%   -6.03%     
==========================================
  Files         163      182      +19     
  Lines        6621     7890    +1269     
  Branches      401      439      +38     
==========================================
+ Hits         6591     7379     +788     
- Misses         30      511     +481     
Files Changed Coverage Δ
src/components/Pagination/helpers.ts 100.00% <ø> (ø)
src/components/Toast/theme.ts 100.00% <ø> (ø)
src/components/Datepicker/Datepicker.tsx 28.43% <28.43%> (ø)
src/components/Datepicker/Views/Days.tsx 36.00% <36.00%> (ø)
src/components/Datepicker/Views/Decades.tsx 37.70% <37.70%> (ø)
src/components/Datepicker/Views/Months.tsx 37.70% <37.70%> (ø)
src/components/Datepicker/Views/Years.tsx 37.70% <37.70%> (ø)
src/components/Banner/BannerCollapseButton.tsx 40.90% <40.90%> (ø)
src/components/Datepicker/helpers.ts 60.13% <60.13%> (ø)
src/components/Banner/Banner.tsx 64.70% <64.70%> (ø)
... and 45 more

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rluders rluders merged commit b1357c6 into themesberg:main Sep 22, 2023
2 of 4 checks passed
@SutuSebastian SutuSebastian deleted the bufix/code-preview/show-explicit-false-props branch September 24, 2023 16:44
maman pushed a commit to transkripid/flowbite-react that referenced this pull request Oct 7, 2023
fix: code preview - show explicit false props; removing `sortProps` since it defaults to `true`

Co-authored-by: Sebastian Sutu <[email protected]>
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.

2 participants