Skip to content

Commit 62c2ceb

Browse files
committed
fix with value component
1 parent fb3862c commit 62c2ceb

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/WithValue/index.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,5 @@ export interface Props {
55
}
66

77
export default function WithValue(props: Props) {
8-
return <ValueContext.Consumer>{value => {
9-
// value should be at least an empty object. This means the context is not mounted yet
10-
if (!value) return null
11-
return props.children(value)
12-
}}</ValueContext.Consumer>
8+
return <ValueContext.Consumer>{value => props.children(value)}</ValueContext.Consumer>
139
}

0 commit comments

Comments
 (0)