Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WindowScroller wrapper prevents react-hot-loader from atomic updates #10

Open
benjamindulau opened this issue May 13, 2020 · 0 comments

Comments

@benjamindulau
Copy link

Hey,

As soon as I add <WindowScroller> wrapper, react-hot-loader can't atomically refresh updates to JSX code anymore and a full app reload (not the browser, but the hot(App)) is fired.

Works great when I remove the <WindowScroller> container wrapper.

i.e:

import React, {Component} from 'react';
import PropTypes from 'prop-types';
import { Provider } from 'react-redux';
import { Router } from 'react-router-dom';
import { createBrowserHistory as createHistory } from 'history';
import { ScrollManager, WindowScroller } from 'react-scroll-manager';
import App from 'ui/containers/App';
import { hot } from 'react-hot-loader/root';
import { PusherProviderContainer } from 'ui/containers/PusherProvider';
import { IntlProvider } from 'react-intl';

class RootContainer extends Component {
    static propTypes = {
        store: PropTypes.object.isRequired,
        pusher: PropTypes.object.isRequired,
    };


    constructor(props, context) {
        super(props, context);

        this.history = createHistory({ basename: "/app" });
    }

    render() {
        const {store} = this.props;

        return (
            <Provider store={store}>
                <IntlProvider locale="fr">
                    <ScrollManager history={this.history}>
                        <Router history={this.history}>
                            <WindowScroller> {/* Prevents react-hot-reload atomic updates */}
                                <PusherProviderContainer pusher={this.props.pusher}>
                                    <App/>
                                </PusherProviderContainer>
                            </WindowScroller>
                        </Router>
                    </ScrollManager>
                </IntlProvider>
            </Provider>
        );
    }
}

export default hot(RootContainer);

Any Idea?

@benjamindulau benjamindulau changed the title Force react-hot-loader to reload entire App Forces react-hot-loader to reload entire App May 13, 2020
@benjamindulau benjamindulau changed the title Forces react-hot-loader to reload entire App WindowScroller wrapper prevent react-hot-loader from atomic updates May 13, 2020
@benjamindulau benjamindulau changed the title WindowScroller wrapper prevent react-hot-loader from atomic updates WindowScroller wrapper prevents react-hot-loader from atomic updates May 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant