Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version 13.0.0 rn 0.69.4 component property change not working #1840

Closed
linjdev opened this issue Aug 18, 2022 · 15 comments · Fixed by #1843
Closed

version 13.0.0 rn 0.69.4 component property change not working #1840

linjdev opened this issue Aug 18, 2022 · 15 comments · Fixed by #1843

Comments

@linjdev
Copy link

linjdev commented Aug 18, 2022

react-native-svg 13.0.0, react-native 0.69.4 component property change not working

Bug

<Star
	fill={isFavorited}
	color={isFavorited ? 'red' : theme.colorText}
/>

Temporary Fix

use different key

{ isFavorited ? <Star
	key="unfavorite"
	fill={isFavorited}
	color={'red'}
/> : <Star
	key="favorite"
	fill={isFavorited}
	color={theme.colorText}
/> }

Environment info

 System:
    OS: macOS 12.0.1
    CPU: (4) x64 Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz
    Memory: 1.44 GB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 17.8.0 - /usr/local/bin/node
    Yarn: 1.22.5 - ~/.yarn/bin/yarn
    npm: 8.13.0 - /usr/local/bin/npm
    Watchman: 2022.03.21.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK: Not Found
    Android SDK: Not Found
  IDEs:
    Android Studio: Not Found
    Xcode: /undefined - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.14.1 - /usr/local/opt/openjdk@11/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.0.0 => 18.0.0 
    react-native: 0.69.4 => 0.69.4 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

@kneza23
Copy link

kneza23 commented Aug 18, 2022

I have the same problem, tnx for the temp fix @linjdev

@kylegillen
Copy link

Could one of you share how you manually linked the project for android use on 0.69 please?

#1839

@linjdev
Copy link
Author

linjdev commented Aug 19, 2022

@nextriot nothing todo. just use latest version react-native and react-native-svg and enable newarch.

@WoLewicki
Copy link
Member

@linjdev on what platforms does the bug appear? @nextriot I will try and make a guide how to do it.

@kneza23
Copy link

kneza23 commented Aug 19, 2022

i do not have newarch enabled and it works out of the box without manual work, i just updated library version in package.json

@linjdev
Copy link
Author

linjdev commented Aug 20, 2022

@WoLewicki Android 12 LineageOS 19 Nexus 5X, not enabled newarch. clean project.

@Bardiamist
Copy link

setNativeProps don't work in react-native-svg 13.0.0
Is it related issue or need to create new one?

<Circle
  r={4}
  fill="#000000"
  opacity={0}
  ref={ref}
/>
ref.current?.setNativeProps({ opacity: 1 });

@WoLewicki
Copy link
Member

@Bardiamist setNativeProps is not available on Fabric, or do you mean that it stopped working on old architecture?

@WoLewicki
Copy link
Member

@linjdev @kneza23 could you check if applying #1843 resolves the problem?

@Bardiamist
Copy link

@Bardiamist setNativeProps is not available on Fabric, or do you mean that it stopped working on old architecture?

stopped working on old architecture

@WoLewicki
Copy link
Member

@Bardiamist I checked it and it is caused by the same issue as the one fixed in #1843, it should work fine for you after applying the change. Could you check it?

@Bardiamist
Copy link

@Bardiamist I checked it and it is caused by the same issue as the one fixed in #1843, it should work fine for you after applying the change. Could you check it?

I tried

"react-native-svg": "git+https://github.com/react-native-svg/react-native-svg#@wolewicki/fix-android-components-not-updating"

Looks good

@Bardiamist
Copy link

Unfortunatelly I still see problems should be related with layout invalidation on Android on old architecture. 13.1.0 works better than 13.0.0 but broke after some layout changes. No problems on iOS. I'll wait some time or will try to create repo with example.

@WoLewicki
Copy link
Member

@Bardiamist please create a repro so we can work on it 🚀

@Bardiamist
Copy link

@WoLewicki ok, I created #1859

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants