Installation¶
Install with npm
:
npm i thebe-react
Overview¶
thebe-react
is a react wrapper for thebe-core
. Integrating thebe-core
into a React based web application presents similar challenges to integrating any stateful 3rd party library that directly manipulates the DOM.
The best approach likely depends on how your application uses jupyter backed components and handles concerns like data (notebook) loading, navigation and dynamic rendering. The components in this library represent a good starting point, but you may need to build your own react components on thebe-core
to acheive the behaviour you want.
The thebe-react
library uses the React Context API and gives you a set of Providers and hooks for Server and Session management as well as hooks for working with notebook and source code fragments. These work well in certain applicaiton setups and one such setup is the demo create-react-app
application that you can find in apps/demo-react
, this is an excellent point of reference.
It will also help to review the thebe-core
's underlying API as these thebe-core
runtime objects are exposed by the react providers and hooks.