Creating a React component

AlloyEditor can be used on the server too. On the server, a possible way of usage is to create a React component, which can render the content for editing and create an instance of AlloyEditor in the browser. This will be a significant performance improvement.

"Talking is cheap, show me the code" (to quote Linus Torvalds)

Instead just explaining how to do it, we actually created an example repository on GitHub, which contains code and instructions for usage. Please follow the instructions there.

The repository is an example project, which renders a page on the server an creates an instance of AlloyEditor in the browser. Same React component is used on both client and server and one cool thing is that instead to create just one bundle file, two bundles are created - one for the application files and another one for AlloyEditor file itself. In this case you will leverage browser's cache.

comments powered by Disqus