bamlab / react-native-image-header-scroll-view

ScrollView with an image in header which becomes a navbar
MIT License
990 stars 94 forks source link

renderForeground (in version 1.0) does not display content when using react navigation 6 #131

Open butri71 opened 1 year ago

butri71 commented 1 year ago

I've been using version 0.10.3 with react navigation 5 with no problem for the past 2 years.

I've recently upgraded to react navigation 6 which force me to upgrade to "react-native-image-header-scroll-view": "^1.0.0" since any previous version has a conflict of dependencies.

With using 1.0 I have to change ImageHeaderScrollView instead of HeaderImageScrollView and import it like this otherwise it would give an error import { ImageHeaderScrollView, TriggeringView } from 'react-native-image-header-scroll-view';

Everything works as before except the content inside the renderFixedForeground() is no longer shown and no error is thrown.

Can you please if this library is still maintained?

Appreciate any help in advance!

Shahfaisal-0304 commented 3 weeks ago

Solution: We needed to replace the legacy context. I used React.createContext in the ImageHeaderScrollView.js file, exported it, and then imported it into the TrigerringView file, using it as static contentType as suggested by the RN logs. (fixed).

https://github.com/user-attachments/files/16958582/Archive.zip