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

super expression must either be null or function #73

Open
ninjia0 opened this issue Jul 26, 2023 · 3 comments
Open

super expression must either be null or function #73

ninjia0 opened this issue Jul 26, 2023 · 3 comments

Comments

@ninjia0
Copy link

ninjia0 commented Jul 26, 2023

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

@billxie1988
Copy link

same isuue super expression must either be null or function

@billxie1988
Copy link

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
Copy link

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.

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

No branches or pull requests

2 participants