nandorojo / solito

🧍‍♂️ React Native + Next.js, unified.
https://solito.dev
MIT License
3.54k stars 181 forks source link

How to import expo icons on web project ? #359

Closed suchcodemuchwow closed 1 year ago

suchcodemuchwow commented 1 year ago

I'm getting an error when I try to import icons:

import Ionicons from '@expo/vector-icons/Ionicons'

Not sure how to load them and there is no documentation how to handle that in solito. Could you please enlighten ?

nandorojo commented 1 year ago

I would recommend not using this package honestly, it causes so many headaches and they plan to move away from it. It’s better to use a library that just uses SVG under the hood. I’ve made two of them using SVGR:

It would be simple to do the same with Ionicons if you want to.

suchcodemuchwow commented 1 year ago

Tried to add your heroicons package which doesn't work out of the box with the solito tailwind template gives bunch of import export errors, I believe it's related to es modules, not sure where to fix in template since it has bunch of different configs.

export * from '../../lib/module/24/outline'
^^^^^^

SyntaxError: Unexpected token 'export'

I tried to install only on root and also platform specific neither of them worked.

nandorojo commented 1 year ago

you need to add it to transpile packages.

suchcodemuchwow commented 1 year ago

Ohhh great thanks a lot 🥳

nandorojo commented 1 year ago

i’ll add a doc about icons in the future

Jonatthu commented 1 year ago

@nandorojo Where I confirm the plans where vector icons are going away?

nandorojo commented 1 year ago

it's just something i heard from the team being tossed around. but in my experience, SVG-based icon libraries are far, far better