question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Open/Close AutoSearchInput dropdown with Redux state

See original GitHub issue

The AutoSearchInput component does setState({ autocompleteIsOpen: true | false }). It should use Redux state instead so that we can use the Redux development tool to work on this component. Beware that setState({ searchValue: '...' }) is still necessary because typing characters in a text box should not dispatch Redux actions.

For QA: Please check for regressions in the autcomplete functionality of the search box in the header

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
willdurandcommented, Mar 23, 2018

To me, this logic (open/close) belongs to the component because it is a pure UI piece of information.

1reaction
tofumattcommented, Mar 23, 2018

To me, this logic (open/close) belongs to the component because it is a pure UI piece of information.

I was thinking that when commenting/talking to @SeanPrashad but wasn’t 100% sure and was admittedly half-occupied with other stuff 😅

Also given it already needs to use setState I think it’s okay to leave out of Redux. The devtools are handy but we already don’t store absolutely everything in Redux (usually in cases like this) so I think it’s okay to not store it here either.

That said, I’m guilty of putting UI stuff in Redux too, so you could use my actions to argue against my words 🤷‍♂️

Read more comments on GitHub >

github_iconTop Results From Across the Web

ReactJs - Redux State is not updating in a dropdown in the ...
I am trying to update the items in my dropdown as my state updates with players BUT I am failing. Please help. In...
Read more >
Redux Fundamentals, Part 3: State, Actions, and Reducers
The official Redux Fundamentals tutorial: learn how reducers update state in response to actions.
Read more >
Store - Redux
Store. A store holds the whole state tree of your application. The only way to change the state inside it is to dispatch...
Read more >
Redux Fundamentals, Part 5: UI and React
Since this component needs both of them, we can select the entire state.filters object. As we mentioned earlier, we could put all the...
Read more >
Redux FAQ: Organizing State
Others prefer to keep non-critical or UI state, such as “is this dropdown currently open”, inside a component's internal state.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found