Skip to content

Commit 4c2d51f

Browse files
committed
Fix layout context prop resolving for boolean types (#567)
1 parent 3808ce4 commit 4c2d51f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
export const resolveContextOrProp = (contextValue, propValue) => {
2-
if (contextValue != null) {
3-
return contextValue;
2+
// We need to test:
3+
// * `false` - for when the `contextValue` is boolean
4+
// * `null` - for when the `contextValue` is non-boolean
5+
if (contextValue === false || contextValue === null) {
6+
return propValue;
47
}
58

6-
return propValue;
9+
return contextValue;
710
};

0 commit comments

Comments
 (0)