nandorojo / solito

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

Warning regarding contentPosition on web #390

Closed cgorrieri closed 1 year ago

cgorrieri commented 1 year ago

After upgrading to Solito@v3, expo-image and also react-native-web@v19 I am now getting the warning:

Warning: React does not recognize the `contentPosition` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `contentposition` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
    at img
    at eval (webpack-internal:///../../node_modules/next/dist/client/image.js:233:11)
    at eval (webpack-internal:///../../node_modules/next/dist/client/image.js:306:11)
    at SolitoImage (webpack-internal:///../../node_modules/solito/build/image/expo/image.web.js:19:108)
...

contentPosition is not a prop of next/image so maybe it should be omitted when passed to NextImage component on https://github.com/nandorojo/solito/blob/18b283a0dbdfdc78f9115a460e4bfbf9b3d57c33/src/image/expo/image.web.tsx#L32.

nandorojo commented 1 year ago

oh looks like RNW is no longer stripping props. that’s interesting…

I’d accept a PR.

cgorrieri commented 1 year ago

Here it is: https://github.com/nandorojo/solito/pull/392

Ipicon commented 1 year ago

+1, wanted to open an issue about it didn't found time do to so

nandorojo commented 1 year ago

is this not in the latest version?

nandorojo commented 1 year ago

Fixed on 3.2.8