Element type is invalid
See original GitHub issueEverything was working fine, but now I’m getting this error when I try to type input. Also getting a warning about getInitialState which is in the package code.
import { GooglePlacesAutocomplete } from 'react-native-google-places-autocomplete';
<GooglePlacesAutocomplete
placeholder={'search'}
minLength={2}
autoFocus={false}
returnKeyType={'search'}
fetchDetails={true}
onPress={(data, details) => {
const lat = details.geometry.location.lat;
const lng = details.geometry.location.lng;
const coords = {
lat: lat,
lng: lng
};
this.setState({ lat: lat, lng: lng });
}}
query={{
key: private,
language: 'en',
}}
GooglePlacesSearchQuery={{
rankby: 'distance',
types: 'geocode'
}}
filterReverseGeocodingByTypes={['locality', 'administrative_area_level_3']}
debounce={200}
keyboardShouldPersistTaps="always"
renderLeftButton={() => <Image source={search} />}
styles={{
textInputContainer: {
height: 40,
backgroundColor: '#181818',
borderTopWidth: 0,
marginLeft: 10,
marginRight: 10,
alignItems: 'center'
},
description: {
color: 'white'
},
textInput: {
height: 40,
color: '#E1E1E5',
paddingBottom: 15,
backgroundColor: 'transparent',
borderBottomWidth: 1,
borderBottomColor: 'grey',
// color: '#5d5d5d',
fontSize: 16
},
poweredContainer: {
backgroundColor: 'transparent'
}
}}
/>
Im using RN 0.42
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:5
Top Results From Across the Web
Invariant Violation: Element type is invalid: expected a string ...
This error can rise if you try to import a non-existent component. Make sure you have no typo and that the component indeed...
Read more >(React) Element type is invalid, expected a string (for built in ...
To solve the error "Element type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got", ......
Read more >Element type is invalid: expected a string (for built-in ... - GitHub
The app breaks and gives this error message: Element type is invalid: expected a string (for built-in components) or a class/function (for ...
Read more >Element type is invalid: expected a string (for built-in ... - Reddit
Getting Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: ...
Read more >Element type is invalid: expected a string (for ... - OneCompiler
Element type is invalid : expected a string (for built-in components) or a class/function (for composite components) but got: undefined.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have a comma there, i just deleted when deleting the key to copy paste.
Downgrading to 1.2.12 worked for me, but I’d like to use the newer version if possible.
@mbelgrader your are missing a comma.
Edit: I now face your issue of the typing in the input, but the missing comma was an issue. I also receive an issue about getInitialState
package.json
EDIT#2
peer dependency issue on my end. downgraded to 1.2.12 and works