Quick Start

The following guide will help you get started on your first Reactforce app

This guide was last refreshed and tested on April 14th, 2023 against Salesforce v57.0 and React 18.

Setup Your Development Environment (one time)

Reactforce is intended to be installed into your Salesforce project folder.

Install the Salesforce CLI if necessary

Install the SFDX CLI by following the instructions here.

Install the Reactforce CLI

The easiest way to get up and running with Reactforce is to use the SFDX plugin:

# Install via NPM
sfdx plugins install @cloudpremise/reactforce@latest

# Accept the plugin
This plugin is not digitally signed and its authenticity cannot be verified. Continue installation (y/N) 
y
...
...
...
Installing plugin @cloudpremise/reactforce... installed v0.0.9

Good to know: If you would like to bypass the warning message for externally developed SFDX plugins, you can whitelist the plugin.

(Optional) Create a trial dev-hub if necessary

Create a Devhub that will last for 30 days if you do not have a production devhub available to you

Authorize your devhub (one time)

Setup Backend (Salesforce Org)

Create a new Salesforce Scratch Org

Install Reactforce reusable assets

Each project and org should be individually configured with shared assets delivered via a static resource. The shared assets are helpful for building Reactforce apps that use the React lightning design system.

Create a new Reactforce App

Generate a new Reactforce app using the default settings

View the generated app

Open the Salesforce Classic App:

Open the automatically generated frontendAppVF
The React app loads with minor modifications to access the Salesforce backend

Modify the react application

This is a good time to setup Hot-Reloading, but it is not covered in this quick start.

Make a change to the React app

Find the following file:

/backend/reactforce/frontend/src/App.js

Make a minor change to the code and save the file. Here is an example modification.

Save the changes.

Package and publish the react code to Salesforce

Go Impress all your friends

The reactforce command line tool will help you to impress all of your friends assuming your friends like building awesome react applications hosted natively from within Salesforce. Happy Coding!

Last updated