-
Notifications
You must be signed in to change notification settings - Fork 131
Open
Description
Describe the feature
Export a contentContainerStyle prop to apply to the inner View inside masked view:
export default class MaskedView extends React.Component<MaskedViewProps> {
_hasWarnedInvalidRenderMask = false;
render(): React.Node {
const { maskElement, children, contentContainerStyle, ...otherViewProps } = this.props;
if (!React.isValidElement(maskElement)) {
if (!this._hasWarnedInvalidRenderMask) {
console.warn(
'MaskedView: Invalid `maskElement` prop was passed to MaskedView. ' +
'Expected a React Element. No mask will render.',
);
this._hasWarnedInvalidRenderMask = true;
}
return <View {...otherViewProps}>{children}</View>;
}
return (
<RNCMaskedView {...otherViewProps}>
<View pointerEvents="none" style={[StyleSheet.absoluteFill, contentContainerStyle]}>
{maskElement}
</View>
{children}
</RNCMaskedView>
);
}
}Today we have it patched locally but it would be ideal if it were possible without the patch
Motivation
The current StyleSheet.absoluteFill is bringing problems in some cases, we have to calculate the size before apply the mask and is kinda annoying when we need to update the size after render.
Metadata
Metadata
Assignees
Labels
No labels