TypeError when wrapping childless components in `<SkeletonProvider />`.
mujtabahasni opened this issue · comments
Description
If the <SkeletonProvider />
contains any childless components, it may cause a type error if the default children prop value is null
. It should skip over any such components as there is no content to skeletonize.
Reproduction Steps
const ChildlLessComp = ({ children }) => {
return (<span>Hello, World!</span))
}
ChildlessComp.propTypes = {
children: PropTypes.node
}
ChildlessComp.defaultProps = {
children: null
}
const WrappedComp = () => (
<SkeletonProvider show={true}>
<ChildLessComp skeleton>
</SkeletonProvider>
)
Workaround details
Do not wrap childless components.
Recommendation
Apply fix in PR: #254
Meta
- TDS version (npm or DSM): vX.Y.Z
- Willing to develop solution: Yes
- Has workaround: Yes
- High impact: No
hey @invalidred any updates on this issue?