react-native-window-view
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

react-native-window-view

Native component for rendering views straight under the Window. Based on RCTPerfMonitor.

Installation

npm install react-native-window-view

Usage

import * as React from 'react';

import { Button, StyleSheet, View } from 'react-native';
import RNWindowView from 'react-native-window-view';

export default function App() {
  const [shown, setShown] = React.useState(true);

  return (
    <View style={styles.container}>
      <Button title="Show/hide window view" onPress={() => setShown(!shown)} />
      <RNWindowView shown={shown}>
        <View style={styles.box} />
      </RNWindowView>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'flex-start',
    justifyContent: 'center',
  },
  box: {
    width: 40,
    height: 40,
    borderRadius: 10,
    borderWidth: 2,
    borderColor: 'black',
    backgroundColor: 'red',
  },
});

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Package Sidebar

Install

npm i react-native-window-view

Weekly Downloads

141

Version

0.3.0

License

MIT

Unpacked Size

23.3 kB

Total Files

17

Last publish

Collaborators

  • wolewicki