Installation | ReScript React (original) (raw)

Requirements:

Add the following dependency to your ReScript project (in case you don't have any project yet, check out the installation instructions):

npm install @rescript/react

Then add the following setting to your existing rescript.json:

JSON

{ "jsx": { "version": 4 }, "bs-dependencies": ["@rescript/react"] }

To test your setup, create a new .res file in your source directory and add the following code:

RES

// src/Test.res @react.component let make = () => { <div> {React.string("Hello World")} </div> }

Now run npx rescript and you should see a successful build.

After a successful installation, @rescript/react will make the following modules available in your project's global scope: