Skip to content

Commit 9722809

Browse files
committed
Fixed conditional hook.
1 parent 94cf413 commit 9722809

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

react-spaces/src/Globals/Hooks.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ export const useSpace = (props: AllProps, divElementRef: React.MutableRefObject<
1414
const setState = (stateDelta: Partial<IState>) => changeState(prev => ({...prev, ...stateDelta}));
1515

1616
const parentContext = React.useContext(SpaceContext);
17-
const currentZIndex = props.zIndex || parentContext || 0;
17+
const layerContext = React.useContext(SpaceLayerContext);
18+
const currentZIndex = props.zIndex || layerContext || 0;
1819

1920
// Deal with property changes to size / anchoring
2021
React.useEffect(() => {

0 commit comments

Comments
 (0)