3.8.0
Info
Build: https://ci.webfilings.com/build/2395385
Skynet Results: https://wf-skynet-hrd.appspot.com/apps/test/smithy/2395385/latest
Pipeline: https://w-rmconsole.appspot.com/release/pipeline/5821374907285504/
This minor release includes the following changes:
New Features
-
🎉 🎉 🎉 Support for function components, memo and hooks!!! 🎉 🎉 🎉
Sooooo much work from so many amazing people made this possible, but to summarize:
- #606 Add support for function components
- #613 Add support for
memo
higher order component - #611 Hooks, hooks, and more hooks!
- useState
- useCallback
- useContext
- useEffect
- useLayoutEffect
- useReducer
- useRef
- useMemo
- useImperativeHandle
- useDebugValue
It works like this...Define the component
mixin FancyBorderProps on UiProps { String color; } UiFactory<FancyBorderProps> FancyBorder = uiFunction( (props) { // props is typed as a `FancyBorderProps` // whatever you return here will be rendered return (Dom.div()..className = 'fancy-border border-${props.color}')( props.children, ); }, // this is the `UiFactoryConfig` $FancyBorderConfig, // ignore: undefined_identifier );
Render the component (exact same consumer API as a class-based component):
import 'package:over_react/over_react.dart'; import 'fancy_border.dart'; // Where your component is defined main() { final renderedWidget = (FancyBorder()..color = /* some color value */)( // put some children here! ); react_dom.render(renderedWidget, querySelector('#idOfSomeNodeInTheDom')); }
Other Changes
- #612 Deprecate
forwardRef
/ adduiForwardRef
as its replacement
Notes created on Monday, August 10 04:16 PM UTC