Skip to content

Commit

Permalink
fix(rdom): fix #304, update Switch.update()
Browse files Browse the repository at this point in the history
- remove extraneous & wrong same-value check which was causing
  component to unmount if same value is received in succession
  • Loading branch information
postspectacular committed Jul 25, 2021
1 parent a9dcd47 commit a2899c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/rdom/src/switch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export class Switch<T> extends Component implements IMountWithState<T> {
async update(val: T) {
this.inner && (await this.inner.unmount());
this.inner = undefined;
if (val != null && val !== this.val) {
if (val != null) {
this.val = val;
let loader: IComponent | undefined;
if (this.loader) {
Expand Down

0 comments on commit a2899c0

Please sign in to comment.