id | keywords | name | summary | category | ||
---|---|---|---|---|---|---|
raw-top-level-expression |
| %%raw | This is the `raw top level expression` extension point. | extensionpoints |
%%raw
is used to embed top level JavaScript code.
<CodeTab labels={["ReScript", "JS Output"]}>
%%raw(`constmessage="hello";functiongreet(m) {console.log(m) }greet(message)`)
constmessage="hello";functiongreet(m){console.log(m);}greet(message);
It's also very useful to do imports with side-effects like this:
<CodeTab labels={["ReScript", "JS Output"]}>
%%raw(`import"main.css"`)
import"main.css";
See %raw
for embedding JavaScript expressions rather than top level blocks of code.