fix: prioritize server rendered Actions in ActionsProvider (#9379)

### 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.
This commit is contained in:
Jarrod Flesch
2024-11-20 13:18:28 -05:00
committed by GitHub
parent ff0386f276
commit 439dcd493e

View File

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