In our apps, we use React context to store global implicits; eg: logger, effect type-class instances, web client backends, etc.
I'm thinking it would be nice to have something like, leveraging Scala 3's context functions:
ScalaFnComponent
.withHooks[Props]
.useImplicitContext(MyContext.ctx)
.useEffectBy( props =>
// Theres an implicit `MyContext` in scope here; ie. this is a `MyContext ?=> Callback`
)
.useState(0)
.render( (props, state) =>
// Theres an implicit `MyContext` in scope here; ie. this is a `MyContext ?=> Callback`
)
In our apps, we use React context to store global implicits; eg: logger, effect type-class instances, web client backends, etc.
I'm thinking it would be nice to have something like, leveraging Scala 3's context functions:
WDYT @japgolly ?