Skip to content

Commit

Permalink
fix: prioritize server rendered Actions in ActionsProvider (#9379)
Browse files Browse the repository at this point in the history
### What?
Actions were not being re-rendered when router.refresh was called.
[Discord
Link](https://discord.com/channels/967097582721572934/1308636510203154462/1308648116031066173)

### Why?
They were stored in state and the state was persisting.

### How?
Spread the stateful actions and the Actions from props on top of the
client state actions.
  • Loading branch information
JarrodMFlesch authored Nov 20, 2024
1 parent ff0386f commit 439dcd4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/ui/src/providers/Actions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,15 @@ export const ActionsProvider: React.FC<{
const [viewActions, setViewActions] = useState(Actions)

return (
<ActionsContext.Provider value={{ Actions: viewActions, setViewActions }}>
<ActionsContext.Provider
value={{
Actions: {
...viewActions,
...Actions,
},
setViewActions,
}}
>
{children}
</ActionsContext.Provider>
)
Expand Down

0 comments on commit 439dcd4

Please sign in to comment.