Skip to content

5.5.0

Compare
Choose a tag to compare
@aaronlademann-wf aaronlademann-wf released this 10 Aug 15:24
· 543 commits to master since this release
2175986

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:

    • #221 Add support for function components
    • #252 Add support for memo higher order component
    • Hooks, hooks, and more hooks!


    It works like this...

    Define 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

  • #253 Deprecate setClientConfiguration.
    • It is no longer necessary - and can be removed from your implementations
  • #273 Make JsBackedMap.values compatible with MSIE 11