nandorojo / solito

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

onLoadingComplete deprecation notice #471

Open jonsherrard opened 7 months ago

jonsherrard commented 7 months ago

Is there an existing issue for this?

Do you want this issue prioritized?

Current Behavior

image

Next have deprecated onLoadingComplete in favor of onLoad.

https://nextjs.org/docs/pages/api-reference/components/image#onloadingcomplete

Would it be possible to update the prop name in SolitoImage to kill off this warning.

Expected Behavior

No warnings.

Steps To Reproduce

Use Solito with latest version of Next.js

Versions

- Solito: 4.2.2
- Next.js: 14.1.3
- Expo:
- React Native:

Screenshots

image

Reproduction

just add onLoadingComplete prop with a void function and you'll get the warning on any SolitoImage component

nandorojo commented 7 months ago

Happy to merge this!

jonsherrard commented 7 months ago

Hi @nandorojo! Thanks again for everything Solito and Solito adjacent

I'm super happy to put in some time to this. Do you think you could. help me out (and others) with a little bit more help on how to develop Solito locally?

For instance - wanted to develop inside my app, do you think that's possible with yarnk link?

I installed expo-module-scripts and ran a build, but no matter I try I get stuck with this error from next:

Failed to compile
../../open-source/solito/build/link/core.js:3:0
Module not found: Can't resolve 'react-native'
  1 | 'use client';
  2 | import { jsx as _jsx } from "react/jsx-runtime";
> 3 | import { Platform } from 'react-native';
  4 | import { openURL } from './linking';
  5 | import { NextLink } from './next-link';
  6 | import { useLink } from './use-custom-link';

https://nextjs.org/docs/messages/module-not-found

Import trace for requested module:
../../open-source/solito/build/link/index.js
../../open-source/solito/link/index.js
./src/components/web-only/nav/index.tsx
./pages/_app.tsx
This error occurred during the build process and can only be dismissed by fixing the error.

This is in a fully functioning Solito app with Tamagui so I know react-native is installed.

Any ideas or extra pointers?

nandorojo commented 7 months ago

Yeah sure thing…this is what happened after all the yarn link steps? I actually haven’t done this particular thing locally with solito, I always just publish it after testing its test app.

It doesn’t look like your app is using yarn link. Instead it appears to be importing directly from the solito repo which is wrong.

I think you’d need to run yarn prepare in the sólito repo, then follow the yarn link steps, and then install it locally with link as well