react-native-popover-typescript
TypeScript icon, indicating that this package has built-in type declarations

0.0.17 • Public • Published

React Native Popover (typescript)

npm version

Install

npm install --save react-native-popover-typescript
 
or
 
yarn add react-native-popover-typescript

Usage example

import React from 'react';
import {View, Text, Image} from 'react-native';
import Popover from 'react-native-popover-typescript';
 
class App extends React.PureComponent {
    options: [{
        title: 'Option 1',
        id: 0,
        icon: <Image
            style={{width: 18, height: 18}}
            source={{uri: 'https://facebook.github.io/react-native/docs/assets/favicon.png'}}
        />,
        isStrippedfalse,
        onSelect(value: {title: string}) => console.log(value.title),
    }, {
        title: 'Option 2',
        id: 1,
        icon: null,
        isStripped: false,
        onSelect: (value: {title: string}) => console.log(value.title),
    }],
 
    onHidden = () => console.log('i\'m hidden now!');
 
    render() {
        <Popover
            options={this.options}
            onHidden={this.onHidden}
        >
            <YourComponentToWrapping />
        </Popover>
    }
}
 
export default App;

Popover

Properties

name description type default
options Components which you wrapping (required) Node []
children Button component (required) Node -
style Popover style Style -
onHidden Callback when popover has become hidden Function -

License

MIT License. © Alexey Gerasimov, 2019.

Package Sidebar

Install

npm i react-native-popover-typescript

Weekly Downloads

29

Version

0.0.17

License

MIT

Unpacked Size

33.2 kB

Total Files

36

Last publish

Collaborators

  • lewka