Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add rerender method #257

Merged
merged 2 commits into from
Nov 24, 2021
Merged

feat: add rerender method #257

merged 2 commits into from
Nov 24, 2021

Conversation

timdeschryver
Copy link
Member

Closes #252

BREAKING CHANGE:

rerender has been renamed to change
change keeps the current fixture intact and invokes ngOnChanges

the new rerender method destroys the current component and creates a new instance
with the updated properties

BEFORE:

const { rerender } = render(...)
rerender({...})

AFTER:

const { change } = render(...)
change({...})

BREAKING CHANGE:

rerender has been renamed to change
change keeps the current fixture intact and invokes ngOnChanges

the new rerender method destroys the current component and creates a new instance
with the updated properties

BEFORE:

const { rerender } = render(...)
rerender({...})

AFTER:

const { change } = render(...)
change({...})
@timdeschryver timdeschryver changed the base branch from main to beta November 24, 2021 20:32
@timdeschryver timdeschryver merged commit 0e5e3c7 into beta Nov 24, 2021
@timdeschryver timdeschryver deleted the update-change branch November 24, 2021 20:43
@github-actions
Copy link

🎉 This PR is included in version 11.0.0-beta.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

timdeschryver added a commit that referenced this pull request Dec 3, 2021
BREAKING CHANGE:

`rerender` has been renamed to `change`.
The `change` method keeps the current fixture intact and invokes `ngOnChanges`.

The new `rerender` method destroys the current component and creates a new instance with the updated properties.

BEFORE:

```ts
const { rerender } = render(...)
rerender({...})
```

AFTER:

```ts
const { change } = render(...)
change({...})
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rerender seems to update props instead of replacing them
1 participant