Passing variable when Phaser.Game starts

Hello
I’d like to pass a variable, which is a stage number and comes from React, to Phaser.Game.

Here is a scenario.
1.React displays stage buttons. Each buttons has stage data attribute.
2.When user clicks the button, React component runs this.game = new Phaser.Game(config)
3.In Preload method of Phaser.Scene, which is the first loaded, loads the stage data dynamically using scene.load.tilemapTiledJSON(“stage”, “./src/assets/maps/“passed variable”.json”);

I don’t know how to deal with #2.
Any advice is welcome.
Thanks

Can you expand on the difficulties you’re facing in #2? I don’t fully understand? Do you have the buttons displaying and everything?

How familiar are you with React?

I found an alternative way.
The question is about data passing issue from react to Phaser, then I just realized that I can still use window global object. This is not the best practice, but it is working at least. So react can set window object and Phaser can assess the same window object.