Running React code in an XBlock

Hey folks, I got time this week to put together a proof of concept that shows how to use React in an XBlock: GitHub - open-craft/xblock-react: An example of a React-based XBlock (React student_view, React studio_view, react-intl)

It’s based on the XBlock cookiecutter (which, sadly, turned out to be broken). It works, integrates with Tutor, uses React 18 for both student_view and studio_view , is compatible with the new Studio unit MFE page, is fully type-safe (TypeScript), and uses react-intl for i18n. It does not support Paragon (as its SCSS is not available and I found that Paragon has a bunch of bugs that make it unsuitable).

I plan to apply some of these changes to the cookiecutter template if they’re well received.

2 Likes