Installation
tip
Clone/reference the starter monorepo to have Solito pre-installed for you.
Install the package​
shyarn add solito
shyarn add solito
Or, with NPM:
shnpm i solito
shnpm i solito
Next.js setup​
You might need next-transpile-modules to run this in your Next.js app, unless transpilePackages works for you. It's been known to have issues with Reanimated, so it depends on whether or not you're using Reanimated.
If you're in a monorepo (which is recommended), start by entering the directory of your Next.js app.
shcd apps/next
shcd apps/next
Next, install the peer dependencies.
yarn add -D next-transpile-modules next-compose-plugins
yarn add -D next-transpile-modules next-compose-plugins
Then run yarn in the root of your monorepo.
Finally, add solito to next-transpile-modules.
Your next.config.js file should look something like this:
jsconst { withExpo } = require('@expo/next-adapter')const withPlugins = require('next-compose-plugins')const withTM = require('next-transpile-modules')(['solito',// add other packages here that need transpiling, such as moti])module.exports = withPlugins([withTM, [withExpo, { projectRoot: __dirname }]], {// your next config goes here ...})
jsconst { withExpo } = require('@expo/next-adapter')const withPlugins = require('next-compose-plugins')const withTM = require('next-transpile-modules')(['solito',// add other packages here that need transpiling, such as moti])module.exports = withPlugins([withTM, [withExpo, { projectRoot: __dirname }]], {// your next config goes here ...})