react-native-ultimate-listview icon indicating copy to clipboard operation
react-native-ultimate-listview copied to clipboard

super expression must either be null or function

Open ninjia0 opened this issue 1 year ago • 3 comments

react: 18.2.0, react-native": "0.71.6, not working at all

ninjia0 avatar Jul 26 '23 08:07 ninjia0

same isuue super expression must either be null or function

billxie1988 avatar Aug 03 '23 03:08 billxie1988

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]}

billxie1988 avatar Aug 03 '23 07:08 billxie1988

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.

billxie1988 avatar Aug 03 '23 07:08 billxie1988