You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[#289] Update most deprecations that were slated for removal in v6.0.0 to be slated for removal in v7.0.0 instead. To keep the migration to v6.0.0 as easy as possible, only APIs that are known to be completely unused will be removed in v6.0.0. Therefore, most APIs that were marked for removal in v6.0.0 will remain until the v7.0.0 release. This PR updated deprecation annotations to reflect this.
55
-
-[#287] Deprecate `SyntheticEvent.isFormEvent`. Because form events do not exist as their own type in ReactJS, this helper will be removed in v6.0.0. Instead, check for the expected [form event types](https://reactjs.org/docs/events.html#form-events).
66
+
-[#289] Update most deprecations that were slated for removal in v6.0.0 to be slated for removal in v7.0.0 instead. To keep the migration to v6.0.0 as easy as possible, only APIs that are known to be completely unused will be removed in v6.0.0. Therefore, most APIs that were marked for removal in v6.0.0 will remain until the v7.0.0 release. This PR updated deprecation annotations to reflect this.
67
+
-[#287] Deprecate `SyntheticEvent.isFormEvent`. Because form events do not exist as their own type in ReactJS, this helper will be removed in v6.0.0. Instead, check for the expected [form event types](https://reactjs.org/docs/events.html#form-events).
-[#282] Add `SyntheticEvent` helpers that eliminate the need to use synthetic event class constructors. Additionally, added utilities to assist in type checking events without manually using the `is` keyword.
71
+
-[#282] Add `SyntheticEvent` helpers that eliminate the need to use synthetic event class constructors. Additionally, added utilities to assist in type checking events without manually using the `is` keyword.
-[#280] Update React dev JS files to include a [workaround](https://github.com/dart-lang/sdk/issues/43193) to a DDC bug when using Chrome 86+ (fixed in Dart 2.9.3)
75
+
-[#280] Update React dev JS files to include a [workaround](https://github.com/dart-lang/sdk/issues/43193) to a DDC bug when using Chrome 86+ (fixed in Dart 2.9.3)
- 🎉 🎉 🎉 __Support for function components, memo and hooks!!!__ 🎉 🎉 🎉
83
95
84
-
Sooooo much work from so many amazing people made this possible, but to summarize:
85
-
96
+
Sooooo much work from so many amazing people made this possible, but to summarize:
97
+
86
98
-[#221] Add support for function components
87
99
-[#252] Add support for `memo` higher order component
88
100
- Hooks, hooks, and more hooks!
@@ -98,41 +110,41 @@ __New Features__
98
110
-[#246] useDebugValue
99
111
100
112
<p><br>It works like this...</p>
101
-
113
+
102
114
Define the component:
103
115
```dart
104
116
import 'package:react/react.dart' as react;
105
-
117
+
106
118
final SomeWidget = react.registerFunctionComponent(_SomeWidget, displayName: 'SomeWidget');
107
-
119
+
108
120
_SomeWidget(Map props) {
109
121
// You can use hooks in here, too!
110
-
122
+
111
123
return react.div({}, [
112
124
// Some children...
113
125
]);
114
126
}
115
127
```
116
-
128
+
117
129
Render the component _(exact same consumer API as a class-based component)_:
118
130
```dart
119
131
import 'package:react/react_dom.dart' as react_dom;
120
132
import 'some_widget.dart'; // Where your component is defined
121
-
133
+
122
134
main() {
123
135
final root = react_dom.createRoot(querySelector('#idOfSomeNodeInTheDom'));
124
136
final renderedWidget = SomeWidget({
125
137
// put some props here
126
138
}, [
127
139
// put some children here!
128
140
]);
129
-
141
+
130
142
root.render(renderedWidget);
131
143
}
132
144
```
133
-
145
+
134
146
> Check out all the [function component and hooks examples](https://github.com/cleandart/react-dart/blob/c9a1211d5d77a9e354b864e99ef8f52b60eeff85/example/test/function_component_test.dart) for more information!
135
-
147
+
136
148
__Fixes / Updates__
137
149
- [#253] Deprecate `setClientConfiguration`.
138
150
- It is no longer necessary - and can be removed from your implementations
@@ -142,7 +154,7 @@ __Fixes / Updates__
142
154
143
155
__New Features__
144
156
- [#244] Add support for [HTML Composition events](https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent)
145
-
- [#263] Add support for [`SyntheticEvent.persist()`](https://reactjs.org/docs/events.html#event-pooling)
157
+
- [#263] Add support for [`SyntheticEvent.persist()`](https://reactjs.org/docs/events.html#event-pooling)
146
158
147
159
__Fixes / Updates__
148
160
- [#261] Stop errors thrown within the call stack of `Component.render()` from being swallowed
0 commit comments