Automatically reload component?

Hey Guys,

I’m new to the Redwood Community, I’m new to Redwood and I’m a beginner when it comes to web development at all. So to sum it up, be aware my question might be a silly one :smiley:

I was wondering if there is a way to automatically reload/ refresh a component in redwood without having to reload the whole page?

I’m thinking of something like:

  1. A button is clicked.
  2. Because of the button click a value, text etc. which is shown in a component changes
  3. Now I want the new value, text etc. to be shown on my page without having to reload the whole page

I’m grateful for every help!

1 Like

Hi @michatw and welcome to the RW community,

No silly questions, but for this one you will want to browse ReactJS documentation and look for hooks, such as useState and useCallback.
You will find plenty of examples of those two.

While you are at it, you should get very familiar very fast with, in order of complexity/importance:

  • useState
  • useCallback
  • useMemo
  • useEffect
  • useReducer

( sorting is actually very personal… but I’ve found this one to make sense when I’ve had to learn all this myself ).

Also, Redwood’s tutorials are gems. Take the time to dig into it, you will learn a great deal in so many areas - and most likely will find examples answering your question.