Skip to main content

How to Tell Whether a Material Is in Edit Mode or Render Mode

Simple scenario

You can use props.__designMode:

image.png

In design mode, __designMode is "design".

In render mode, __designMode is not set.

Advanced scenario

Define editUrls in the asset package:

image.png

editUrls

Create a new view.tsx under lowcode/xx/:

image.png

Then run:

npm run lowcode:build

After that, build/lowcode will contain view.js, which you can configure as editUrls in the asset package.

image.png