Skip to content

Commit

Permalink
Fix context not passed through from primary renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
michalochman committed Nov 9, 2018
1 parent 56a9f03 commit 6f17365
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

### Fixed
- Fixed context not passed through from primary renderer (`react-dom`) into `react-pixi-fiber`


## [0.5.1] - 2018-11-02

Expand Down
4 changes: 2 additions & 2 deletions src/Stage.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class Stage extends React.Component {
const stageProps = getDisplayObjectProps(this.props);
applyProps(this._app.stage, {}, stageProps);

render(<AppProvider app={this._app}>{children}</AppProvider>, this._app.stage);
render(<AppProvider app={this._app}>{children}</AppProvider>, this._app.stage, undefined, this);
}

componentDidUpdate(prevProps, prevState) {
Expand All @@ -90,7 +90,7 @@ class Stage extends React.Component {
this._app.renderer.resize(currentWidth, currentHeight);
}

render(<AppProvider app={this._app}>{children}</AppProvider>, this._app.stage);
render(<AppProvider app={this._app}>{children}</AppProvider>, this._app.stage, undefined, this);
}

componentWillUnmount() {
Expand Down
4 changes: 2 additions & 2 deletions src/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ export const roots = new Map();
* element should be any instance of PIXI DisplayObject
* containerTag should be an instance of PIXI root Container (i.e. the Stage)
*/
export function render(element, containerTag, callback) {
export function render(element, containerTag, callback, parentComponent) {
let root = roots.get(containerTag);
if (!root) {
root = ReactPixiFiber.createContainer(containerTag);
roots.set(containerTag, root);
}

ReactPixiFiber.updateContainer(element, root, undefined, callback);
ReactPixiFiber.updateContainer(element, root, parentComponent, callback);

ReactPixiFiber.injectIntoDevTools({
findFiberByHostInstance: ReactPixiFiber.findFiberByHostInstance,
Expand Down

0 comments on commit 6f17365

Please sign in to comment.