diff --git a/doc/component.md b/doc/component.md index 38b115dc..b19f7ba3 100644 --- a/doc/component.md +++ b/doc/component.md @@ -16,7 +16,7 @@ export class Counter extends Component { } increment(delta) { - this.updateState({ counter: this.state.counter + delta }); + this.state.counter += delta; } } ``` @@ -88,9 +88,6 @@ It is not called on the initial render. This is useful to get some information which are in the DOM. For example, the current position of the scrollbar -Note that at this point, it is not safe to rerender the widget. In -particular, updateState calls should be avoided. - ### patched This hook is called whenever a component did actually update its props, diff --git a/src/component.ts b/src/component.ts index 0a0418c8..bc6835e0 100644 --- a/src/component.ts +++ b/src/component.ts @@ -168,9 +168,6 @@ export class Component< * It is not called on the initial render. This is useful to get some * information which are in the DOM. For example, the current position of the * scrollbar - * - * Note that at this point, it is not safe to rerender the widget. In - * particular, updateState calls should be avoided. */ willPatch() {}