Using React in developing new content type library



Can you point to some good example about usin React in a content type library? I found,  but a bit more simple solution would be more helpful.

The old documentation  h5p-react  and the h5p-wrapper don't seem to work any more.

Or do you have different experience?



serettig's picture

I recently wrote two demo content types. They are a bit unusual in that they use an experimental extension to H5P that implements a shared state (which allows users to see other users' actions). You have to ignore the multi-user state parts and the config files for them (opLogicCheck.json opSchema.json, snapshotLogicCheck.json, snapshotSchena.json). They are both written in React, though, so you might be able to draw on this as inspiration. (super simple functionality) (Kahoot-style functionality, more complex)


Thanks, Sebastian!

This is a good start! I donwloaded your library, I was able to build it and upload in my test site. I am not familiar with typescript but I hope I will figure out how to rewrite it to Javascript/JSX.

Definitely helpful!


If it may help anyone -  I created a simple h5p-react-boilerplate project  - to get things started:

Here is a simple depo project that I created -  perhaps useful for others, too:

serettig's picture

Great, this might be very useful. What I can really recommend is using for previews. Debugging and testing H5P libraries can be pretty time-consuming and preview JS is a great tool to decrease time doing the visual tests!