How to use Dynamic Terrain with React?

I am trying to use Dynamic Terrain with React but unfortunately, I am stuck at this error:

| var terrain = new DynamicTerrain("t", params, scene);
> ReferenceError: DynamicTerrain is not defined
>     at BabylonScene._this.generateTerrain (
>     at BabylonScene._this.componentDidMount (

I am usiong react so I have included Dynamic Terrain extension in Head

<!DOCTYPE html>
<html lang="en">
    <!--Physics & Loader-->
    <script src=""></script>
    <script src=""></script>
    <script src=""></script>
    <script src=""></script>
    <script src=""></script>

    <title>React App</title>

      You need to enable JavaScript to run this app.
    <div id="root"></div>

I also tried loading in componentDidMount but I get the same error

var s = document.createElement("script");

// wait for dynamic terrain extension to be loaded
s.onload = this.generateTerrain();
s.src =

Is there any solution to this or is there any npm package I can use with es6 ?

Pinging @jerome who is the creator of the Dynamic Terrain

I think it’s the same issue than the one discussed here : Need help with including Dynamic Terrain extension. TypeError DynamicTerrain is not a constructor

No npm module planned (from me) for now as I don’t know how to do this. Any contributor welcome :wink: