diff --git a/doc/hooks.md b/doc/hooks.md index 3d609053..ed9797fc 100644 --- a/doc/hooks.md +++ b/doc/hooks.md @@ -181,6 +181,9 @@ class Counter extends owl.Component { } ``` +It is important to remember that `useState` only works with objects or arrays. It +is necessary, since Owl needs to react to a change in state. + ### `onMounted` `onMounted` is not a user hook, but is a building block designed to help make useful diff --git a/doc/store.md b/doc/store.md index 02549c9f..bb562edc 100644 --- a/doc/store.md +++ b/doc/store.md @@ -262,6 +262,10 @@ will only be rerendered whenever this part of the state changes. Otherwise, it will perform a strict equality check and will update the component every time this check fails. +Also, it may not be obvious, but it is crucial to remember that the selector +function should return an object or an array. The reason is that it needs to be +observed, otherwise the component would not be able to react to changes. + ### `useDispatch` The `useDispatch` hook is useful when a component needs to be able to dispatch