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
- Host: GitHub
- URL: https://github.com/evanbacon/react-native-ink
- Owner: EvanBacon
- License: mit
- Created: 2019-10-18T20:10:17.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-08-11T14:34:06.000Z (over 3 years ago)
- Last Synced: 2025-03-19T07:33:10.597Z (about 1 month ago)
- Topics: expo, expo-web, ink, react-native, react-native-cli, react-native-web
- Language: TypeScript
- Size: 3.61 MB
- Stars: 30
- Watchers: 3
- Forks: 0
- Open Issues: 25
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
👋 Welcome toreact-native-ink
A library for creating CLIs with agnostic primitives like View, Text, Image, TextInput, etc...
![]()
---
# 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.
---