cawfree / react-native-localhost

โš›๏ธ ๐Ÿก Returns the local address of your actual development machine.

Home Page:https://twitter.com/cawfree

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-native-localhost

โš›๏ธ ๐Ÿก Returns the local address of your actual development machine.

๐Ÿš€ Getting Started

Using Yarn:

yarn add react-native-localhost

โœ๏ธ Usage

Okay, so this is really simple.

Basically, whenever you run npm i or yarn, a postinstall hook for this package is triggered, which determines your machine's local ip address and writes it to the module's default export:

import * as React from 'react';
import { Text } from 'react-native';
import localhost from 'react-native-localhost';

export default function App(): JSX.Element {
  return <Text>{`Development machine is running on: ${localhost}`}</Text>;
}

That's it. Nothing magical, and certainly nothing fit for use in production.

โœŒ๏ธ License

MIT

About

โš›๏ธ ๐Ÿก Returns the local address of your actual development machine.

https://twitter.com/cawfree

License:MIT License


Languages

Language:JavaScript 66.1%Language:TypeScript 33.9%