Closed tigerraj32 closed 6 years ago
I got the error message as well
me too
+1
Hi,
I've started investigating this issue, and for now I managed to not have this error and display the dropdown (although I have another error on select). I'll try to make a PR when I have time.
What allowed to begin fixing was using new import syntax :
_ On all files in node_modules/react-native-dropdown/ replace:
const React = require('react-native');
with
import React, { Component } from 'react';
and make those sort of changes :
const {
StyleSheet,
Component,
View,
Text
} = React;
by
import { StyleSheet, View, Text } from 'react-native';
(beware to remove Component since it's included via the previous command).
Then replace :
extends Component
with
extends React.Component
And it shouldn't do this error again. I'll try to do a PR tomorrow if I can.
Edit : just saw this PR #41 that does these changes...
until the pull request #41 is accepted you can fix it problem by directly using that specific PR.
I am also getting the same error ....please fix this as soon as possible
+1
+1
+1
I'm still encountering the same issue, I basically copied the code on README.md to test on my app but the error still appears. I notice that there hasn't been any response on this issue since 6 months ago, is this project not maintained anymore?
Hi,
I've started investigating this issue, and for now I managed to not have this error and display the dropdown (although I have another error on select). I'll try to make a PR when I have time.
What allowed to begin fixing was using new import syntax :
_ On all files in node_modules/react-native-dropdown/ replace:
const React = require('react-native');
with
import React, { Component } from 'react';
and make those sort of changes :
const { StyleSheet, Component, View, Text } = React;
by
import { StyleSheet, View, Text } from 'react-native';
(beware to remove Component since it's included via the previous command).
Then replace :
extends Component
withextends React.Component
And it shouldn't do this error again. I'll try to do a PR tomorrow if I can.
Edit : just saw this PR #41 that does these changes...
why we need to edit node_modules's file. it is ignored by git. is it a bug?
Look like the bug was fixed in this git repo, but he hasnt published the change to a new npm version?
it is got fixed? "react-native-dropdown": "0.0.6", try the demo. 04-23 09:49:11.581 1421-1610/com.ahbapp E/ReactNativeJS: Super expression must either be null or a function, not undefined
import React, {Component} from 'react' import {StyleSheet, Text, TextInput, View} from "react-native"; import {Col, Grid, Row} from "react-native-easy-grid"; import {Option, OptionList, Select, updatePosition} from 'react-native-dropdown' import withNavigation from "react-navigation/src/views/withNavigation";
class PathShow extends Component { constructor(props) { super(props) this.state = { pathCategory: '', canada: '' } }
componentDidMount() {
updatePosition(this.refs['SELECT1']);
updatePosition(this.refs['OPTIONLIST']);
}
_getOptionList() {
return this.refs['OPTIONLIST'];
}
_canada(province) {
this.setState({
...this.state,
canada: province
});
}
render(): React.ReactNode {
return (
<View style={{height: '100%', width: '100%'}}>
<Grid style={styles.searchContainer}>
<Row style={{width: '100%', height: 60}}>
<Col size={20}>
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
<Select
width={250}
ref="SELECT1"
optionListRef={this._getOptionList.bind(this)}
defaultValue="Select a Province in Canada ..."
onSelect={this._canada.bind(this)}>
<Option children={'Yukon'}></Option>
</Select>
<Text>Selected provicne of Canada: {this.state.canada}</Text>
<OptionList ref="OPTIONLIST"/>
</View>
</Col>
<Col size={80}>
<View style={{backgroundColor: '#FFFFFF'}}>
<TextInput style={styles.searchBoxStyle} autoFocus={true} placeholder={'输入查询条件'}>
</TextInput>
</View>
</Col>
</Row>
<Row size={80}>
</Row>
</Grid>
</View>
)
}
}
const styles = StyleSheet.create({ searchBoxStyle: { borderBottomWidth: 1, borderBottomColor: '#6275ff' }, searchContainer: { // backgroundColor:'#FFFFFF' } }) export default withNavigation(PathShow);
It's fixed in this git repo, but the author hasnt published a new npm version for it!
same issue
I got this error message after i install this package. Super expression must either be null or a function, not undefined Module AppRegistry is not a registered callable module.
I have react-native-cli: 1.0.0 react-native: 0.26.3 node: v4.4.3