In the playground, I am able to use
console.log(BABYLON.OBJExport.OBJ([sphere]));
When I create a react project with the same code, I get:
TypeError: Cannot read property ‘OBJ’ of undefined
In this project I have installed:
npm install --save babylonjs
npm install --save babylonjs babylonjs-serializers
And in the code it is imported as:
import * as BABYLON from "babylonjs";
import "babylonjs-serializers";