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 Oct 24, 2024
1 parent d532592 commit 904e9df
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 904e9df

Please sign in to comment.