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

UIP-2637 Release over_react 1.16.1 (HOTFIX) #108

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# OverReact Changelog

## 1.16.1

> [Complete `1.16.1` Changeset](https://github.com/Workiva/over_react/compare/1.16.0...1.16.1)

__Bug fixes__

* [#108]: Fix case where `setState` and store trigger only result in one `FluxUiComponent` render

## 1.16.0

> [Complete `1.16.0` Changeset](https://github.com/Workiva/over_react/compare/1.15.1...1.16.0)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

```yaml
dependencies:
over_react: "^1.16.0"
over_react: "^1.16.1"
```

2. Add the `over_react` [transformer] to your `pubspec.yaml`.
Expand Down
2 changes: 1 addition & 1 deletion lib/src/component_declaration/flux_component.dart
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ abstract class _FluxComponentMixin<TProps extends FluxUiProps> implements Batche
});
}

void componentDidUpdate(Map prevProps, Map prevState) {
void componentWillReceiveProps(Map prevProps) {
// Let BatchedRedraws know that this component has redrawn in the current batch
didBatchRedraw = true;
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: over_react
version: 1.16.0
version: 1.16.1
description: A library for building statically-typed React UI components using Dart.
homepage: https://github.com/Workiva/over_react/
authors:
Expand Down
25 changes: 25 additions & 0 deletions test/over_react/component_declaration/flux_component_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,31 @@ void main() {
expect(nested1.renderCount, 3, reason: 'should have rerendered once in response to the store triggering');
expect(nested2.renderCount, 3, reason: 'should have rerendered once in response to the store triggering');
});

test('redraws twice in response to a the component calling setState and a store trigger happening at the same time', () async {
var store = new Store();

TestNestedComponent nested0;

render(
(TestNested()
..store = store
..ref = (ref) { nested0 = ref; }
)()
);
expect(nested0.renderCount, 1, reason: 'setup check: initial render');

nested0.setState({});
store.trigger();
// Two async gaps just to be safe, since we're
// asserting that additional redraws don't happen.
await nextTick();
await nextTick();

expect(nested0.renderCount, 3,
reason: 'should have rerendered once in response to the store triggering'
' and once in response to setState');
});
});
}

Expand Down