Commit 9f7b0964 authored by chechunchi's avatar chechunchi

bridge redux context

parent 13746858
import React from "react";
import { Engine, Scene } from "react-babylonjs";
import { ReactReduxContext, Provider } from "react-redux";
import * as BABYLON from "@babylonjs/core";
import * as CONFIG from "../../config/ui";
import DuelHands from "./hands_";
const BabylonCanvas = () => (
<div>
<Engine antialias adaptToDeviceRatio canvasId="babylonJS">
<Scene>
<DuelCamera />
<DuelLight />
<DuelHands />
<DuelGround />
</Scene>
</Engine>
</div>
<ReactReduxContext.Consumer>
{({ store }) => (
<Engine antialias adaptToDeviceRatio canvasId="babylonJS">
<Scene>
<Provider store={store}>
<DuelCamera />
<DuelLight />
<DuelHands />
<DuelGround />
</Provider>
</Scene>
</Engine>
)}
</ReactReduxContext.Consumer>
);
const DuelCamera = () => (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment