diff --git a/README.md b/README.md index 839cc93..a0fd8fb 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,25 @@ # react-ton-x + [![npm version](https://badge.fury.io/js/react-ton-x.svg)](https://badge.fury.io/js/react-ton-x) ![npm dependencies](https://img.shields.io/librariesio/release/npm/react-ton-x) ## Installation -``` + +```zsh yarn add react-ton-x ``` + ## Usage -Wrap your root component with **TonhubConnectProvider** + +You need add [hook](https://usehooks.com/useLocalStorage/) manually in the project which is developing +Then wrap your root component with **TonhubConnectProvider** + ```jsx import { RemoteConnectPersistance, TonhubConnectProvider } from 'react-ton-x'; const App = () => { // use any persistent state you want for remote connector - const [connectionState, setConnectionState] = useLocalStorage('connection', { state: 'initing' }); + const [connectionState, setConnectionState] = useLocalStorage('connection', { type: 'initing' }); return ( { ) } -``` +``` + When use hook in any child component: + ```jsx import { useTonhubConnect } from 'react-ton-x'; @@ -48,4 +56,4 @@ const Page = () => { ) } -``` \ No newline at end of file +```