Skip to content

Commit

Permalink
Fix layout context prop resolving for boolean types (#567)
Browse files Browse the repository at this point in the history
  • Loading branch information
atmelmicro committed Nov 26, 2024
1 parent 3808ce4 commit 4c2d51f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/_helpers/resolveContextOrProp.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
export const resolveContextOrProp = (contextValue, propValue) => {
if (contextValue != null) {
return contextValue;
// We need to test:
// * `false` - for when the `contextValue` is boolean
// * `null` - for when the `contextValue` is non-boolean
if (contextValue === false || contextValue === null) {
return propValue;
}

return propValue;
return contextValue;
};

0 comments on commit 4c2d51f

Please sign in to comment.