📝 Docs: Update README - ContextMenuAuxPreviewExample01

This commit is contained in:
Dominic Go 2022-06-26 06:29:00 +08:00
parent a9635453ad
commit 235cb51052

View File

@ -2157,7 +2157,36 @@ export function ContextMenuViewExample19(props) {
[🔗 Full Example](example/src/examples/ContextMenuAuxPreviewExample01.tsx)
```jsx
TBA
// 📝 Note: for the sake of brevity, some of the code is omitted...
export function ContextMenuAuxPreviewExample01(props) {
return (
<ContextMenuView
menuConfig={{
// ...
}}
isAuxiliaryPreviewEnabled={true}
renderAuxiliaryPreview={() => (
<View style={[styles.auxRootContainer, {
// by default, the root view you returned will be
// resized to match the width of the preview
// (you can override this behavior via the
// `auxiliaryPreviewConfig` prop).
//
// since this view is going to be resized, let's
// center the content...
alignItems: 'center',
justifyContent: 'center',
}]}>
<TouchableOpacity style={styles.buttonContainer}>
{ /** ... */ }
</TouchableOpacity>
</View>
)}
>
{/** ... */}
</ContextMenuView>
);
};
```
<br>