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(cx): return a consistent string type #21

Merged
merged 2 commits into from
Oct 17, 2022
Merged

Commits on Oct 17, 2022

  1. fix(cx): return a consistent string type

    This has a downside that if you call cx with values that are all falsy, an empty class will be written, but upside that you can rely on string manipulation later if needed.
    
    This changes the snapshot of highlight, but not the real life usage, as that's called with a string that definitely exists.
    
    This isn't a breaking change in my opinion, as an empty className and no className act identical, and this solution is much simpler than #20 or changing all code related to classNames in InstantSearch to have every key optional (even if they actually aren't going to be undefined)
    
    For reference, the `classnames` package is also typed to always return a string.
    Haroenv committed Oct 17, 2022
    Configuration menu
    Copy the full SHA
    f842066 View commit details
    Browse the repository at this point in the history
  2. Update packages/shared/src/__tests__/cx.test.ts

    Co-authored-by: Sarah Dayan <[email protected]>
    Haroenv and sarahdayan authored Oct 17, 2022
    Configuration menu
    Copy the full SHA
    a02eccf View commit details
    Browse the repository at this point in the history