-
Notifications
You must be signed in to change notification settings - Fork 386
feat(hooks): implement SortBy component #3373
Conversation
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 b3840aa:
|
✔️ Deploy Preview for react-instantsearch ready! 🔨 Explore the source changes: b3840aa 🔍 Inspect the deploy log: https://app.netlify.com/sites/react-instantsearch/deploys/6221f6e213c8260007dac221 😎 Browse the preview: https://deploy-preview-3373--react-instantsearch.netlify.app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
packages/react-instantsearch-hooks-dom/src/widgets/__tests__/SortBy.test.tsx
Show resolved
Hide resolved
looks like something with the types loses specificity in the index.test.tsx, maybe try putting the component instantiation inside the switch instead of just the props? |
@Haroenv I'm afraid that's a little too dynamic for TypeScript, and we'll need to either maintain code to make it understand the mapping better (defeating the purpose of importing all widgets from the barrel) or just disable type checking there. Test will fail if we pass wrong parameters anyway so I'd say, let's |
I fixed it in 1e1ef03 @sarahdayan, with the same cast still needed (as Object.entries isn't type-safe for some dumb reason microsoft/TypeScript#35101) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo bem
Summary
This introduces the
SortBy
DOM widget.Ticket: FX-1164
Results
SortBy
widgetSortBy
with the widget in example