# Migration
# v2 to v3
v3 is React concurrent mode safe. There will be no synchronous subscription.
- If synchronous values from observables are used as initial state, move the initialization logic to the
initialStateparameter ofuseObservableState,useObservablePickStateanduseObservableGetState. useGetObservableStateandusePickObservableStatesignatures are incompatible. The new addedinitialStateis not optional.- If
initialStateis a function it will be called. If you need to use function as state wrap it with an extra function.
# v3 to v4
v4 is not compatible with TypeScript 3.
- remove the readonly modifier of
useObservableanduseLayoutObservabledependency list.
# v3.0.0 to v4.2.0
- Errors in Observable will not be automatically re-thrown to Error Boundary. Use
useRenderThrowexplicitly.
← Gotchas