From 359af257a3cf84acae033224384f203f56ced233 Mon Sep 17 00:00:00 2001 From: Tianxiao Wang Date: Tue, 26 Mar 2019 15:46:28 +0800 Subject: [PATCH] fix: standalone build (#32) --- packages/griffith-standalone/src/index.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/griffith-standalone/src/index.js b/packages/griffith-standalone/src/index.js index 0ce5b2e7..386c0b78 100644 --- a/packages/griffith-standalone/src/index.js +++ b/packages/griffith-standalone/src/index.js @@ -3,13 +3,21 @@ import ReactDOM from 'react-dom' import Player from 'griffith' export function createPlayer(target) { + function render(props) { + ReactDOM.render(, target) + } + + render() + return { render(props) { - ReactDOM.render(, target) + render(props) + return this }, dispose() { - ReactDOM.unmountComponentAtNode(target) + ReactDOM.render(null, target) + return this }, } }