pull/463/head
Cory LaViska 2021-05-03 11:32:59 -04:00
rodzic c8e94ea098
commit 4c1e077833
2 zmienionych plików z 3 dodań i 4 usunięć

Wyświetl plik

@ -8,6 +8,7 @@ _During the beta period, these restrictions may be relaxed in the event of a mis
## Next
- Fixed a bug where setting properties before an element was defined would render incorrectly [#425](https://github.com/shoelace-style/shoelace/issues/425)
- Improved a11y in `sl-progress-ring`
- Updated React docs to use [`@shoelace-style/react`](https://github.com/shoelace-style/react)
- Updated NextJS docs [#434](https://github.com/shoelace-style/shoelace/pull/434)

Wyświetl plik

@ -63,8 +63,7 @@ export class EventEmitter<T> {
// @watch decorator
//
// Runs after an observed property changes, e.g. @property or @state. This will only run after the first
// update, so initial attribute => property mappings will not trigger the watch handler.
// Runs after an observed property changes, e.g. @property or @state.
//
// Note that changing props in a watch handler *will* trigger a rerender. To make pre-update changes to observed
// properties, use the `update()` method instead.
@ -80,7 +79,7 @@ export function watch(propName: string) {
const { updated } = protoOrDescriptor;
protoOrDescriptor.updated = function (changedProps: Map<string, any>) {
if (this.__hasBeenUpdated && changedProps.has(propName)) {
if (changedProps.has(propName)) {
const oldValue = changedProps.get(propName);
const newValue = this[propName];
@ -90,7 +89,6 @@ export function watch(propName: string) {
}
updated.call(this, changedProps);
this.__hasBeenUpdated = true;
};
};
}