Deploying react-redux app in AWS S3

前端 未结 3 1252
攒了一身酷
攒了一身酷 2020-12-01 05:44

I have gone through lot of similar questions in stack overflow like this one. Each one have different perspective of deploying the react app.

But this question is fo

3条回答
  •  时光取名叫无心
    2020-12-01 06:24

    If there is anyone who stumbles into this post, and the solution doesn't work because of a infinite loop in the history.listen function; For me the solution was to add a small timeout for the history.replace(path) call. So it looks like this:

        history.listen(location => {
          const path = (/#!(\/.*)$/.exec(location.hash) || [])[1];
            if (path) {
              setTimeout(() => {
                history.replace(path);
              }, 100);
            }
          });
    

提交回复
热议问题