An open API service indexing awesome lists of open source software.

https://github.com/evanbacon/react-native-ink

React Native for CLIs
https://github.com/evanbacon/react-native-ink

expo expo-web ink react-native react-native-cli react-native-web

Last synced: about 1 month ago
JSON representation

React Native for CLIs

Awesome Lists containing this project

README

        


👋 Welcome to
react-native-ink


A library for creating CLIs with agnostic primitives like View, Text, Image, TextInput, etc...





GitHub Actions status

---

# NOT READY YET :]

## 🏁 Setup

Install `react-native-ink` in your project.

```sh
yarn add react-native-ink
```

Alias `react-native` to `react-native-ink`:

1. `yarn add -D babel-plugin-module-resolver`
2. Create alias:
`babel.config.js`

```js
module.exports = {
// ...
plugins: [
[
'babel-plugin-module-resolver',
{
alias: {
'react-native': 'react-native-ink',
},
},
],
],
};
```

## ⚽️ Usage

```tsx
import React, { useEffect, useState } from 'react';
import { AppRegistry, View, Text, Image, TextInput } from 'react-native';

const Counter = () => {
const [counter, setCounter] = useState(0);

useEffect(() => {
const timer = setInterval(() => {
setCounter(prevCounter => prevCounter + 1);
});

return () => {
clearInterval(timer);
};
});

return (

{counter} tests passed

);
};

AppRegistry.registerComponent('main', () => Counter);
```

## License

The Expo source code is made available under the [MIT license](LICENSE). Some of the dependencies are licensed differently, with the BSD license, for example.

---






License: MIT