react-native-ultimate-listview
react-native-ultimate-listview copied to clipboard
super expression must either be null or function
react: 18.2.0, react-native": "0.71.6, not working at all
same isuue super expression must either be null or function
subClass: [Function RefreshableScrollView] superClass: {"$$typeof": Symbol(react.forward_ref), "Context": {"$$typeof": Symbol(react.context), "Consumer": {"$$typeof": Symbol(react.context), "_calculateChangedBits": null, "_context": [Circular]}, "Provider": {"$$typeof": Symbol(react.provider), "_context": [Circular]}, "_calculateChangedBits": null, "_currentRenderer": {}, "_currentRenderer2": null, "_currentValue": null, "_currentValue2": null, "_threadCount": 0}, "displayName": "ScrollView", "render": [Function Wrapper]}
I just try to fix it with this
replace export default class RefreshableScrollView extends ScrollView
with export default class RefreshableScrollView extends Component
The short answer is: ScrollView component is not supported to be extended via inheritance in react-leaflet library. In fact even React official documentation encourages to prefer composition over inheritance:
At Facebook, we use React in thousands of components, and we haven’t found any use cases where we would recommend creating component inheritance hierarchies.
Props and composition give you all the flexibility you need to customize a component’s look and behavior in an explicit and safe way. Remember that components may accept arbitrary props, including primitive values, React elements, or functions.