Apollo link state vs built-in React state

76 Views Asked by At

I was thinking if I should use React built-in state state = {} when using apollo link state. Should I keep everything what is my local state in the apollo link state? Let me give you an example:

I have a <Modal> component which has a state:

state={visible: true}

Should be the above "state" kept in the apollo link state or React built-in state?

1

There are 1 best solutions below

0
On

It largely depends on personal preference.

If the local state you want to save is related to the server state then i would use apollo
otherwise for something simple i would just use setState