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
{{ message }}
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.
I saw the talk about mapPropsStream eventually being used internally to do that. But it seems it's not currently implemented. It seems createEagerElementUtil will only do this for the first container:
if (!hasKey && isReferentiallyTransparent) {
if (children) {
return type({ ...props, children })
}
return type(props)
}
After that, the wrapped functional component becomes a class and in further calls isReferentiallyTransparent will no longer be true, and therefore more wrappers than needed will be used.
To make this concrete, I'd like to be able to make the following usage of 2 containers result in one class container:
For me that's a common case and I'm thinking of just making withStates that accepts an array and lets you provide more than one state to guarantee only one container class is used. But obviously that only would work for withState. Does anyone have a more general solution? Any idea on the status of the mapPropsStream solution?
The text was updated successfully, but these errors were encountered:
I saw the talk about
mapPropsStream
eventually being used internally to do that. But it seems it's not currently implemented. It seemscreateEagerElementUtil
will only do this for the first container:https://github.com/acdlite/recompose/blob/master/src/packages/recompose/utils/createEagerElementUtil.js
After that, the wrapped functional component becomes a class and in further calls
isReferentiallyTransparent
will no longer betrue
, and therefore more wrappers than needed will be used.To make this concrete, I'd like to be able to make the following usage of 2 containers result in one class container:
For me that's a common case and I'm thinking of just making
withStates
that accepts an array and lets you provide more than one state to guarantee only one container class is used. But obviously that only would work forwithState
. Does anyone have a more general solution? Any idea on the status of themapPropsStream
solution?The text was updated successfully, but these errors were encountered: