diff --git a/lib/src/over_react_redux/over_react_flux.dart b/lib/src/over_react_redux/over_react_flux.dart index 58fcbeb43..651f9bfaf 100644 --- a/lib/src/over_react_redux/over_react_flux.dart +++ b/lib/src/over_react_redux/over_react_flux.dart @@ -355,9 +355,9 @@ mixin InfluxStoreMixin on flux.Store { /// If you do not provide [mergeProps], the wrapped component receives {...ownProps, ...stateProps, ...dispatchProps} /// by default. /// -/// - [areOwnPropsEqual] does an equality check using JS `===` (equivalent to [identical]) by default. -/// - [areStatePropsEqual] does a shallow Map equality check using JS `===` (equivalent to [identical]) by default. -/// - [areMergedPropsEqual] does a shallow Map equality check using JS `===` (equivalent to [identical]) by default. +/// - [areOwnPropsEqual] does an equality check using [propsOrStateMapsEqual] by default. +/// - [areStatePropsEqual] does a shallow Map equality check using [propsOrStateMapsEqual] by default. +/// - [areMergedPropsEqual] does a shallow Map equality check using [propsOrStateMapsEqual] by default. /// /// - [context] can be utilized to provide a custom context object created with `createContext`. /// [context] is how you can utilize multiple stores. While supported, this is not recommended. @@ -417,9 +417,11 @@ UiFactory Function(UiFactory) Map Function(TActions actions, TProps ownProps) mapActionsToPropsWithOwnProps, Map Function(TProps stateProps, TProps dispatchProps, TProps ownProps) mergeProps, - bool Function(TProps nextProps, TProps prevProps) areOwnPropsEqual, - bool Function(TProps nextProps, TProps prevProps) areStatePropsEqual, - bool Function(TProps nextProps, TProps prevProps) areMergedPropsEqual, + // Use default parameter values instead of ??= in the function body to allow consumers + // to specify `null` and fall back to the JS default. + bool Function(TProps nextProps, TProps prevProps) areOwnPropsEqual = propsOrStateMapsEqual, + bool Function(TProps nextProps, TProps prevProps) areStatePropsEqual = propsOrStateMapsEqual, + bool Function(TProps nextProps, TProps prevProps) areMergedPropsEqual = propsOrStateMapsEqual, Context context, bool pure = true, bool forwardRef = false, @@ -570,7 +572,7 @@ UiFactory Function(UiFactory) // In dev mode, if areStatePropsEqual is not specified, pass in a version // that warns for common pitfall cases. assert(() { - if (areStatePropsEqual == null) { + if (areStatePropsEqual == propsOrStateMapsEqual) { bool areStatePropsEqualWrapper(TProps nextProps, TProps prevProps) { const propHasher = CollectionLengthHasher(); diff --git a/lib/src/over_react_redux/over_react_redux.dart b/lib/src/over_react_redux/over_react_redux.dart index 108cc8927..0ecc4d2e7 100644 --- a/lib/src/over_react_redux/over_react_redux.dart +++ b/lib/src/over_react_redux/over_react_redux.dart @@ -90,9 +90,9 @@ typedef dynamic Dispatcher(dynamic action); /// by default. /// /// - [areStatesEqual] does an equality check using JS `===` (equivalent to [identical]) by default. -/// - [areOwnPropsEqual] does a shallow Map equality check using JS `===` (equivalent to [identical]) by default. -/// - [areStatePropsEqual] does a shallow Map equality check using JS `===` (equivalent to [identical]) by default. -/// - [areMergedPropsEqual] does a shallow Map equality check using JS `===` (equivalent to [identical]) by default. +/// - [areOwnPropsEqual] does a shallow Map equality check using [propsOrStateMapsEqual] by default. +/// - [areStatePropsEqual] does a shallow Map equality check using [propsOrStateMapsEqual] by default. +/// - [areMergedPropsEqual] does a shallow Map equality check using [propsOrStateMapsEqual] by default. /// /// - [context] can be utilized to provide a custom context object created with `createContext`. /// [context] is how you can utilize multiple stores. While supported, this is not recommended. :P @@ -149,9 +149,11 @@ UiFactory Function(UiFactory) connect