We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I get this error on react native "expected a component class got object object"
I'm just copy pasting thhe code that appears on the instantsearch guide of react native (InstantSearch) to my new and clean project that appears in here: https://community.algolia.com/instantsearch.js/react/guide/React_native.html
import React, {Component} from 'react'; import { AppRegistry, StyleSheet, Text, View, ListView, TextInput, Image, } from 'react-native'; import {InstantSearch} from 'react-instantsearch/native'; import {connectSearchBox, connectInfiniteHits} from 'react-instantsearch/connectors';
export default InfiniteSearch = () => ;
const SearchBox = connectSearchBox(({currentRefinement, refine}) => <TextInput style={{height: 40, borderColor: 'gray', borderWidth: 1}} onChangeText={(text) => refine(text)} value={currentRefinement} /> );
const Hits = connectInfiniteHits(React.createClass({ onEndReached: function () { if (this.props.hasMore) { this.props.refine(); } },
render: function () { const dataSource = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2}); const hits = this.props.hits.length > 0 ? : null;
return hits;
},
_renderRow: function (hit) { return ( <Image style={{height: 100, width: 100}} source={{uri: hit.image}} /> {hit.name} ); }, }));
const styles = StyleSheet.create({ maincontainer: { backgroundColor: 'white', flex: 1, paddingTop: 20, paddingBottom: 10, flexDirection: 'column', }, list: { flex: 1, flexDirection: 'column', }, item: { flexDirection: 'row', alignItems: 'center', backgroundColor: 'white' } });
AppRegistry.registerComponent('InfiniteSearch', () => InfiniteSearch);
The text was updated successfully, but these errors were encountered:
@bobylito is working on a patch #1729 👍
Sorry, something went wrong.
5b76f75
No branches or pull requests
I get this error on react native "expected a component class got object object"
I'm just copy pasting thhe code that appears on the instantsearch guide of react native (InstantSearch) to my new and clean project that appears in here: https://community.algolia.com/instantsearch.js/react/guide/React_native.html
import React, {Component} from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
ListView,
TextInput,
Image,
} from 'react-native';
import {InstantSearch} from 'react-instantsearch/native';
import {connectSearchBox, connectInfiniteHits} from 'react-instantsearch/connectors';
export default InfiniteSearch = () =>
;
const SearchBox = connectSearchBox(({currentRefinement, refine}) =>
<TextInput
style={{height: 40, borderColor: 'gray', borderWidth: 1}}
onChangeText={(text) => refine(text)}
value={currentRefinement}
/>
);
const Hits = connectInfiniteHits(React.createClass({
onEndReached: function () {
if (this.props.hasMore) {
this.props.refine();
}
},
render: function () {
const dataSource = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});
const hits = this.props.hits.length > 0 ?
:
null;
},
_renderRow: function (hit) {
return (
<Image
style={{height: 100, width: 100}}
source={{uri: hit.image}}
/>
{hit.name}
);
},
}));
const styles = StyleSheet.create({
maincontainer: {
backgroundColor: 'white',
flex: 1,
paddingTop: 20,
paddingBottom: 10,
flexDirection: 'column',
},
list: {
flex: 1,
flexDirection: 'column',
},
item: {
flexDirection: 'row',
alignItems: 'center',
backgroundColor: 'white'
}
});
AppRegistry.registerComponent('InfiniteSearch', () => InfiniteSearch);
The text was updated successfully, but these errors were encountered: