Closed dmytro587 closed 1 year ago
Should be fixed in lib-react-components@3.1.5
. Please try.
Should be fixed in
lib-react-components@3.1.5
. Please try.
You probably accidentally close this issue instead of #123 because in new version fixed only bug described on #123
Yes. My mistake. Reopened.
@dmytro587 Could you provide an example of using? I do not understand a little, for example, why should we render the Typography without content.
@dmytro587 Could you provide an example of using? I do not understand a little, for example, why should we render the Typography without content.
children
prop since:
1.1. null
and undefined
is valid values for the render
1.2. we don't handle rendering if children
is falsy value, we still render children
whatever it is, so at the moment we get a warning on an empty space. I've done a little research on some other libraries and they don't give warnings if pass falsy values to them, and just display nothing. For example https://codesandbox.io/s/pjll5x?file=/demo.tsx Ant Design has Typography with margins too.Successfully published:
- lib-react-components@3.1.6
I'm got a several warnings during passing unit tests on the Hancock.
Tooltip. Need to mark children prop as optional since we get warning if pass null or undefined. It get rid of us from the
Failed prop type: The prop 'content' is marked as required in 'Tooltip', but its value is 'null'
warnings.TooltipPopper. Need to mark children prop as optional, it get rid of us from the
Failed prop type: The prop 'children' is marked as required in 'TooltipPopper', but its value is 'null'
warnings.Typography. Need to mark children prop as optional, it get rid of us from the
Failed prop type: The prop 'children' is marked as required in 'Typography', but its value is 'undefined'
warnings.Tooltip & TooltipPopper. I got
Failed prop type: Invalid prop 'usePortal' supplied to 'Tooltip'
andFailed prop type: Invalid prop 'usePortal' supplied to 'TooltipPopper'
warnings, but to the prop was passed a correct value. I have a guess about the wrong type definition of usePrortal here and here, theusePortal: PropTypes.oneOfType([PropTypes.bool, HTMLElementType])
definition according to the documentation fixed warnings for me.