Open
Conversation
no need to call fallback()
Owner
|
Hi thanks for the PR. Ideally things which are api changes I would prefer to have an issue made first. but thats my fault for not have a contributors guide. Im happy to go this route though, as after testing this pattern on a prototype doesn't seem to have any major problems with this implementation, and i guess is more consistent with how other libraries deal with passing components as props. the main problem setting this back is that the tests, types (fallback prop) and storybook are all broken because of this change. These will need to be updated/fixed before this gets merged Show › renders fallback if "when" is falsy
expect(received).toBeTruthy()
Received: null
37 | setup({when: false, fallback: FallBack});
38 | expect(screen.queryByText(Text.default)).toBeNull()
> 39 | expect(screen.queryByText(Text.fallback)).toBeTruthy()
| ^
40 | });
41 |
42 | it('renders children if "when" is true, with fallback', () => {
at Object.<anonymous> (src/components/Show/Show.test.tsx:39:47)
|
Open
Owner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
no need to call fallback()