Unitools | Install in Expo | By GeekyAnts
Steps
- Installation - Install all the
@unitools
packages 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/*-expo
andreact-native
toreact-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-config
yarn add @unitools/image @unitools/link @unitools/router @unitools/tailwindcss-fonts @unitools/fonts @unitools/image-expo @unitools/link-expo @unitools/router-expo @unitools/metro-config
Install the required peer-dependencies.
npm install expo-image expo-router
yarn add expo-image expo-router
Add 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", }, }, ] ],};