Bot releases are hidden (Show)
Published by joebingham-wk almost 4 years ago
Published by aaronlademann-wf about 4 years ago
This release of react includes...
New Features
🎉 🎉 🎉 Support for function components, memo and hooks!!! 🎉 🎉 🎉
Sooooo much work from so many amazing people made this possible, but to summarize:
memo
higher order componentDefine the component:
import 'package:react/react.dart' as react;
final SomeWidget = react.registerFunctionComponent(_SomeWidget, displayName: 'SomeWidget');
_SomeWidget(Map props) {
// You can use hooks in here, too!
return react.div({}, [
// Some children...
]);
}
Render the component (exact same consumer API as a class-based component):
import 'package:react/react_dom.dart' as react_dom;
import 'some_widget.dart'; // Where your component is defined
main() {
final renderedWidget = SomeWidget({
// put some props here
}, [
// put some children here!
]);
react_dom.render(renderedWidget, querySelector('#idOfSomeNodeInTheDom'));
}
Check out all the function component and hooks examples for more information!
Fixes / Updates
setClientConfiguration
.
JsBackedMap.values
compatible with MSIE 11