React js
.Net
React with DotNet

React context

React Context is a powerful feature that allows you to manage and share state or data across a component tree without having to pass props down manually at every level.

ReactWithDotNet has only one context. Every component can access this context
Let's show you on an example how to manage db connection.

When request started

initialize db connection

Before send response to client

You can use this connection object in component

You can manage session, theme or other futures that you want as just like in this sample