ModalBottomSheet (when not nativeOverlay) seems to use a custom in-library Portal implementation that reparents the sheet into a different tree, this makes child components/tree unable to use existing context from the tree.
// psuedocode
const Cx = createContext();
const SheetUser = () => {
return (
<Cx value={1}>
<ModalBottomSheet ...>
<Inner />
</ModalBottomSheet>
</Cx>
)
}
const Inner = () => {
const value = useContext(Cx)
// value is always undefined
return ...
}
This should either be documented on the documentation or it could be solved by using a library such as react-native-teleport
PS. I came across this issue while trying to add keyboard avoidance to a nativeOverlay modal sheet, and it does not seem to be really possible - keyboard state is undetectable inside the sheet. Should I make another issue for that?
ModalBottomSheet(when notnativeOverlay) seems to use a custom in-library Portal implementation that reparents the sheet into a different tree, this makes child components/tree unable to use existing context from the tree.This should either be documented on the documentation or it could be solved by using a library such as react-native-teleport
PS. I came across this issue while trying to add keyboard avoidance to a nativeOverlay modal sheet, and it does not seem to be really possible - keyboard state is undetectable inside the sheet. Should I make another issue for that?