Skip to content

Commit

Permalink
fix 1 missed double comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
dderg committed Sep 5, 2023
1 parent 399f4e2 commit 52f1d31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/@react-facet/core/src/components/With.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const hasData = <T,>(_: Facet<T | null | undefined>, shouldRender: boolean | NoV
}

export const With = <T,>({ data, children }: WithProps<T>) => {
const shouldRenderFacet = useFacetMap((data) => data !== undefined, [], [data])
const shouldRenderFacet = useFacetMap((data) => data !== null && data !== undefined, [], [data])
const shouldRender = useFacetUnwrap(shouldRenderFacet)
return hasData(data, shouldRender) ? children(data) : null
}

0 comments on commit 52f1d31

Please sign in to comment.