I expected the result to be “Hello, world!”, but the code produced an empty result. Can React be used in card templates? If yes, how?
My Anki version is 2.1.38 (355e4cd5)
Thanks.
I just tried using React in a card template, and it seems to work, but a few workarounds seems to be required to get it to work properly. Firstly, loading React files with <script src=""></script> seems not to work, so I think maybe dynamic loading of external js files is required. For example, see Linking to external javascript . In addition, maybe type="text/babel" doesn’t work, so you might need to run JSX Preprocessor from command line. The following is a script, which I modified to work on a card template on Anki, from the example source code in Add React to a Website page.