Skip to content

Commit

Permalink
fix: wujie-react watch props change, restart app (#689)
Browse files Browse the repository at this point in the history
  • Loading branch information
heziqiang authored Oct 13, 2023
1 parent 37dc95b commit 1b39612
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/wujie-react/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ export default class WujieReact extends React.PureComponent {
this.startApp();
}

componentDidUpdate(prevProps) {
if (this.props.name !== prevProps.name || this.props.url !== prevProps.url) {
this.startApp();
}
}

render() {
const { width, height } = this.props;
const { myRef: ref } = this.state;
Expand Down

0 comments on commit 1b39612

Please sign in to comment.