React Admin white page on EditView - javascript

I'm working with React Admin, I have and EditView, when I redirect the user from the table to the EditView, it works perfect, BUT, when I push f5 and recharge the site, the same view shows a white page:
I think this has to be with the Resource definition, I have define this:
<Resource name="books" list={BooksList} edit={BooksEdit} />
The fetch to the api works fine, for that reason I think that the problem is something that I dont understand on the Edit, Show config.
I dont have Show view, because when I click on the table, I want the edit view without more clicks.

It is because when you refresh the page, the components return to their first state. The state that you're creating is not being saved anywhere, so when you hit F5 the state "goes back to the beginning".

Related

how to update slack home tab after view_submission from Modal?

I'm working on the Slack bot using js and trying to have the home tab rerender anytime I use a model to execute an action. To notice a new change in the home tab, I must refresh the page. For instance, if I use the modal to alter or remove a block after submitting the model, the changes won't show up right away; I'll need to refresh the page to see them.
I've been looking for this answer for days, but I haven't come up with anything that will work.

When clicking browser back button it duplicates history while using iframe in react route

I'm facing a weird bug while using an iframe in one route in my company react app.
I have route for "/home" and "/maintenance", "/maintenance" uses iframe. When I am in "/maintenance" route and click browser back button to take me to home page, it shows homepage overlapping maintenance page.
I tried using key attribute in iframe it didn't work. Please let me know if anyone have found solution for this.

Navigating to different page without saving changes yields a page that just says 'Home'

There is a page having some information where if we try to make same change(i.e., if we select any device to load and change it's description) and at the same time if we make move to different tab by clicking yes to the question that do you want to move without saving the change it goes to page saying "Home", instead of going to the required tab.
Please help me to make the changes, so this doesn't happen, it mostly occurs at the first login to the application after the most recent logout.
We use angular in FE.
give each tab a route in routing-module and if you go to that route from home and then to another page the on discard you can use location.back() and you will be navigated back to that tab

Nextjs page refresh after clicking a route button for the first time

Basically, when the initial page build happens and we are on the index page, after clicking any button that changes the route, for example, the Link tag, the router method using push and replace, (yes, i have tried both) triggers a page refresh the first time, after the reload happens and i click the button again, rendering actually happens and i get to the route i want, how do i make it so that the first refresh does not happen and the user can just get to the route they want? Please ask me any more information you need.
I don't know much about next.js but I think it doesn't refresh the page in production. Even if it does then next.js will caches that on the server which means only 1st user has to face the refresh.

Skip jump link in browser's history using Angular 2

I use Angular 2 (v2.4.4) and by using routerLink I navigate between the components.
This works fine, but if I load the very save component with the very same snapshot parameter (active.snapshot.params) the page won't get loaded again. So, for example if I am on /page/56 and I click on a link here which points to /page/56, the very same link (from a menu or something), the component won't reload. (And things might change in the database since the last load, so the page needs to be reloaded.)
I bypassed it by pointing to /jump/page/56 and the Page 404 controller redirects to /page/56.
This also works fine, but if I navigate back in the browser from /page/56, it will get to /jump/page/56 which directs to /page/56 by the Page 404 controller. So basically I cannot navigate back.
As much as I know, I cannot delete browser history by the HTML5 history API, but how could I go back to the page, which was right before /page/56, just by simply clicking on the back button of the browser?
The solution might be a simple JavaScript trick independent from Angular 2, as it does not actually load a new page just loads a different component and changes the URL. (Also because of this I should not use location.reload() because it will reload Angular 2 and all the depending JS, etc.)
Thank you for your solutions in advance!
you can use skipLocationChange Like :
this.router.navigate(['/jump/page/12'],{skipLocationChange:true});
Seems the only way is to create your own dicrective inherited from [routerLink] to control click handler or just add click handler to current element with managing refresh by yourself.
<a (click)="navigate(['/jump/page/56'])">Navigate</a>
where
navigate(route) {
this.router.navigate(route, {replaceUrl: true});
}

Categories