reactTips - sassoftware/restaf GitHub Wiki

Importing into react and similar applications

Many users use create-react-app and similar cli's to build their UI's. In these cases you can do th following:

  1. Install @sassoftware/restaf and @sassoftware/restaflib as part of your application.

  2. In your UI code(say a react componenent) you can import these as follows

import * as restaf from '@sassoftware/restaf/dist/restaf.js";
import * as restaflib from '@sassoftware/restaflib/dist/restaflib.js";

You can then use it like all other JS modules

let store = restaf.initStore();
etc...