rn-use-interval

0.0.3 • Public • Published

rn-use-interval

Installation

npm i rn-use-interval --save

How to use

const App = ()  => {
  const [time, setTime] = React.useState(0);
  useInterval(() => setTime(time+1), 1000);

  return (
      <>
        <SafeAreaView style={styles.container}>
          <Text>{time}</Text>
        </SafeAreaView>
      </>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center'
  }
});

Readme

Keywords

Package Sidebar

Install

npm i rn-use-interval

Weekly Downloads

3

Version

0.0.3

License

ISC

Unpacked Size

4.86 kB

Total Files

13

Last publish

Collaborators

  • hienpham2102