# react-native-as-modal

> HOC to convert a component into modal

Latest version **0.1.4** (published 2020-06-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-as-modal
pnpm add react-native-as-modal
yarn add react-native-as-modal
bun add react-native-as-modal
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2020-06-07 |
| First published | 2020-06-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 26 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Vamshi krishna |
| Maintainers | vamshi9666 |
| Keywords | react-native, ios, android |

## Links

- npm: https://www.npmjs.com/package/react-native-as-modal
- Repository: https://github.com/vamshi9666/react-native-as-modal
- Homepage: https://github.com/vamshi9666/react-native-as-modal#readme
- Issues: https://github.com/vamshi9666/react-native-as-modal/issues
- npm.io page: https://npm.io/package/react-native-as-modal

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.1.4 (latest) — 2020-06-07
- 0.1.3 — 2020-06-06
- 0.1.2 — 2020-06-06
- 0.1.1 — 2020-06-06

## README

# react-native-as-modal

HOC to convert a react native component into modal

## Installation

```sh
npm install react-native-as-modal

```

## Usage

```js
import AsModal from "react-native-as-modal";


const Body = (props) => {
  const { onClose } = props
  return (
    <View style={{ backgroundColor: 'white', padding: 24 }}>
      <Text>this s modal body</Text>
      <Button title={'close'} onPress={onClose} />
    </View>
  );
};

// wrap a component with AsModal HOC 
const BodyAsModal = AsModal(Body)

// with options 
const BodyAsModal = AsModal(Body, {
  gesturesEnabled: true
})

export default function App() {
  const [modalVisible, setModalVisible] = React.useState(false);
  return (
    <>
      <BodyAsModal
        visible={modalVisible}
        onClose={() => setModalVisible(false)}
      />
      <View style={styles.container}>
        <Button
          title={'open modal'}
          onPress={() => setModalVisible(!modalVisible)}
        />
      </View>
    </>
  );
}

```

## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License

MIT

---
_Source: https://npm.io/package/react-native-as-modal · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
