kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Merge branch 'revert-511f1de4' into 'develop'
Revert "Merge branch 'react-17-deprecated' into 'develop'" See merge request soapbox-pub/soapbox-fe!879features-override
commit
d4ded71d3a
|
@ -26,7 +26,7 @@ class Bundle extends React.PureComponent {
|
||||||
onFetchFail: noop,
|
onFetchFail: noop,
|
||||||
}
|
}
|
||||||
|
|
||||||
static cache = new Map()
|
static cache = new Map
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
mod: undefined,
|
mod: undefined,
|
||||||
|
@ -34,12 +34,12 @@ class Bundle extends React.PureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.load();
|
this.load(this.props);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate(prevProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
if (this.props.fetchComponent !== prevProps.fetchComponent) {
|
if (nextProps.fetchComponent !== this.props.fetchComponent) {
|
||||||
this.load();
|
this.load(nextProps);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,8 +49,8 @@ class Bundle extends React.PureComponent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
load = () => {
|
load = (props) => {
|
||||||
const { fetchComponent, onFetch, onFetchSuccess, onFetchFail, renderDelay } = this.props;
|
const { fetchComponent, onFetch, onFetchSuccess, onFetchFail, renderDelay } = props || this.props;
|
||||||
const cachedMod = Bundle.cache.get(fetchComponent);
|
const cachedMod = Bundle.cache.get(fetchComponent);
|
||||||
|
|
||||||
if (fetchComponent === undefined) {
|
if (fetchComponent === undefined) {
|
||||||
|
|
Ładowanie…
Reference in New Issue