-
Notifications
You must be signed in to change notification settings - Fork 19
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
Reactive search example #13
Comments
Hey @ericmcgregor I have the same issue, do you found the solution? |
@theodorDiaconu some help here? |
This code is deprecated right? https://github.com/cult-of-coders/grapher-react/blob/master/legacy/createQueryContainer.js |
@danilomiranda @ericmcgregor e.g.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How would i properly use withQuery to create a component that can search a collection?
Let's say i have a PostList component which i am wrapping reactively withQuery. I'd like to have an input filed which I would pass as a search filter on the query. but i'm not sure how i would do this? How do you alter the query and have it update the component internally, without passing in props?
class PostList extends Component {
search(query, e){
let regex = new RegExp(e.target.value, 'i');
[do something with query]
query.params.filters = {
name:regex
}
}
render(){
<Input type={"text"} onChange={this.search.bind(this, this.props.query)}/>
}
}
const Container = withQuery((props) => {
return getPostLists.clone();
}, {reactive: true})(PostList);
The text was updated successfully, but these errors were encountered: