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.

How to get/set Griddle state outside of component?

See original GitHub issue

Griddle 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:closed
  • Created 6 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
MichaelDeBoeycommented, Feb 15, 2018

@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 🙂

0reactions
dahlbykcommented, Feb 14, 2018

I’m seeing it more like an extra ‘global’ state, that I can access, like I do with my own Redux state.

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 same storeKey, 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.

Read more comments on GitHub >

github_iconTop 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 >

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