Unitools | Install in Expo | By GeekyAnts
Steps
- Installation - Install all the
@unitoolspackages required. - Configuration - Please configure the project correctly, refer this docs
- File Setup - Add Support for
.expo-web.{js|ts|jsx|tsx}file extension. - Aliases Setup - Add aliasing of
@unitools/*packages to@unitools/*-expoandreact-nativetoreact-native-web.
Installation
Run the following commands to install all the packages supported under unitools.
npm install @unitools/image @unitools/link @unitools/router @unitools/tailwindcss-fonts @unitools/fonts @unitools/image-expo @unitools/link-expo @unitools/router-expo @unitools/metro-configyarn add @unitools/image @unitools/link @unitools/router @unitools/tailwindcss-fonts @unitools/fonts @unitools/image-expo @unitools/link-expo @unitools/router-expo @unitools/metro-configInstall the required peer-dependencies.
npm install expo-image expo-routeryarn add expo-image expo-routerAdd aliasing
For @unitools/image, @unitools/link, and @unitools/router to work in Expo we need to alias
it with @unitools/image-expo, @unitools/link-expo, and @unitools/router-expo respectively
module.exports = { plugins: [ [ "module-resolver", { alias: { "@unitools/link": "@unitools/link-expo", "@unitools/image": "@unitools/image-expo", "@unitools/router": "@unitools/router-expo", "@unitools/fonts": "@unitools/fonts/expo", }, }, ] ],};