How to embed raw JavaScript containing template literals in ReScript?

Viewed 15

For example, the following ReScript does not compile:

%%raw(`
const s = 'world';
const msg = `Hello ${s}!`;
console.log(s);
`)

The ReScript compiler (10.0.1) errors out at the backtick before Hello:

Syntax error!

3 | const msg = `Hello ${s}!`;

consecutive statements on a line must be separated by ';' or a newline
0 Answers
Related