问题标签 [react-laravel]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
203 浏览

reactjs - 如何使用 Laravel Mix 为 React Lazy 块设置目标位置?

所以我的 React Lazy 设置效果很好,我使用 Laravel Mix 而不是普通的 Webpack 配置。但是运行后,(命名的)块都放在 public 文件夹中,而不是 public/js 文件夹中。该站点运行良好,但只是为了组织,如果分块的 js 文件位于单独的 js 文件夹中,我会喜欢它,因为公共文件夹将挤满所有块。有人知道答案吗?:)

0 投票
1 回答
53 浏览

javascript - How to understand a React file

I am using React in Laravel and I found a problem that I can't refresh or reload a page in React. So to solve this problem I found many suggestions like use historyApiFallback, 404 page and many other ways But I found none of them useful to me now.

I know I can't do this because React has no system for it because of server- and client-side routing. Then i found a demo project where they used Redux and I can refresh their page. I got the demo project where i can use any component and refresh them how many times I want. So there is a file name with Base.js and I am not understanding this file why he used it what is doing. Let me share the file and where it was used.

Base.js

Header.Js

Public.js

split.js

Now it has authenticated system so I understand it but why it is using base function and what it is doing? I am not understanding.