Skip to content

Instantly share code, notes, and snippets.

@jyash97
Last active April 24, 2019 11:37
Show Gist options
  • Save jyash97/1cfc9075edda43c5d792c772554cd9ae to your computer and use it in GitHub Desktop.
Save jyash97/1cfc9075edda43c5d792c772554cd9ae to your computer and use it in GitHub Desktop.
<div className={container}>
<ReactiveList
pagination
componentId="results"
react={{
and: ["search"]
}}
dataField="title.keyword"
>
{({ loading, data, error }) => {
if (loading) {
return <p>Loading...</p>;
}
if (error) {
return <p>Something Went Wrong!</p>;
}
if (data.length) {
return (
<ReactiveList.ResultCardsWrapper>
{data.map(item => (
<ResultCard key={item._id}>
<ResultCard.Image src={item.image} />
<ResultCard.Title
dangerouslySetInnerHTML={{
__html: item.original_title
}}
/>
</ResultCard>
))}
</ReactiveList.ResultCardsWrapper>
);
} else {
return <p>No Results Found</p>;
}
}}
</ReactiveList>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment