Minimal react configuration for only-ever read only

Hi - I don’t think this is a use case I’ve seen here before (even in Read-only editor still changeable? - #2 by inducer) so here goes…

I’m using CM to display code that will never ever be editable. All I want is the syntax colouring and line numbers, nothing else… How can I configure it in React to optimise to ensure the smallest possible bundle size? Just setting EditorState.readOnly still seems iiuc to be including a load of stuff I know I’ll never need…

I don’t really see what React has to do with this. But indeed, loading the editor library will create a lot of bundle size that you do not need. The way to go is probably to just load a parser create your own highlighting markup (see this example), rendering the code in a way that also includes line numbers.