-
Notifications
You must be signed in to change notification settings - Fork 49.1k
Closed
Description
With the new context API it is really bulky to create a middle man that consumes one context value, transforms it and provides another one. You have to create many components and store an intermediate state to avoid rerendering the provider if the input is unchanged.
We could have a convenience API for this use case.
function transform(inputValue) {
return [...inputValue, extraData];
}
<Context.Middleware transform={transform}>{children}</Context.Middleware>
cc @acdlite
jquense, bjrmatos, hamlim, jaredLunde, cogell and 2 morejquense