Open Whoaa512 opened 9 years ago
CC: @StevenIseki, any thoughts about the above?
I will be keen to get some examples of using it with a redux store as you mention, hoping to play around with it tonight.
One thought I did have was to have a redux-search module that was a binding to the react-search component, the redux-search module could possibly be used with other type of view engines, not bound to react.
It could be used with a react-native-search component or possibly riot or mithril. Not sure if many other component libraries are in use with redux at the moment, but something to think about.
Just an update, I'm not sure exactly how a redux-search module would work, as I am still in the early stages of using redux.
I was keen to also make a deku-search component, so if you are using redux you can use either react-search or deku-search for your component. As redux doesn't depend on react or deku it might be useful to have a redux-search module, or possibly just make both components play nicely with redux.
Back on the point of fixing up the matching-items:
To eliminate having the state in the search component for matching items could be eliminated and the props could that are passed in as an array could be a map in the search component
this.props.items [‘ada’, ‘c’, julia]
becomes a map
this.props.items = {
item: ‘ada’, matched: false,
item: ‘c’, matched: true,
item: ‘julia’, matched: false
}
Also I think we should pass back the items in the callback onChange and onClick. Is this a common way items are passed back from dumb components to containers in redux?
It would be awesome if this could be re-written to:
matchingItems
in a redux storechangeInput
andselectAutoComplete