How to get/set Griddle state outside of component?
See original GitHub issueGriddle version
1.11.1
Question
How can I get (and set) the Griddle state from outside the component?
Like you can see in the CodeSandbox, I want to use (for testing purposes, just show) the filter
value and the actions.setFilter
function outside the Griddle component.
Is there a recommended way of doing this?
CC: @dahlbyk
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (7 by maintainers)
Top Results From Across the Web
Set React component state from outside of component
In your component tree structure. you should set the selected item as state in the parent (not in the item). And pass the...
Read more >Member's Mark 3-Piece Modular Outdoor Kitchen 5 Burner Grill
Modular: Flexible design adjusts to fit your deck; Five-burner grill: Quickly cooks meats and vegetables; Stainless steel construction: Resists rust and the ...
Read more >LEr: LOW ERROR READING - Traeger Support
It is an error message specific to non-WiFIRE grills with 3-digit, Digital Controllers. An LEr means that your grill dropped below 125°F for ......
Read more >Trending in reviews - Amazon.com
...pieces-parts in the dishwasher. The non-stick grill surface comes out perfect every time. I do hand-clean the drip tray and water tray after...
Read more >lowes outdoor grills
Hello Everyone,Today, I am sharing the last part of my patioIts an Outdoor Modular Kitchen Gas Grill/Putting Green!I hope you ENJOYBE INSPIRED &...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@dahlbyk Yeah I know it’s not global, but I think you understand what I’m trying to say.
Just feels a bit grim at first, but after some thoughts about it, it (like you said) an implementation detail, so as long as I’m not creating custom components that replace the default ones, I indeed should keep that piece of state in my own store and just pass it as a prop 🙂
Except it’s not global. It’s mostly hidden inside the
<Griddle />
. 😀 And if you have a page with two<Griddle />
instances, even if they use the samestoreKey
, you’ll have two distinct internal stores.If you want ‘global’ state, the right thing to do is to put it in your own app’s Redux store.