UNPKG

@lido-sdk/react

Version:

This project is being slowly deprecated and may not receive further updates. Check out [modern Lido SDK](https://github.com/lidofinance/lido-ethereum-sdk/pulls) to access latest functionality. It is actively maintained and is built for interacting with Li

12 lines (9 loc) 319 B
import { useContext } from 'react'; import invariant from 'tiny-invariant'; import { SDKContext } from '../context/SDK.js'; const useSDK = () => { const contextValue = useContext(SDKContext); invariant(contextValue, 'useSDK was used outside of SDKContext'); return contextValue; }; export { useSDK };