mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-08-02 00:51:52 +00:00
Fixed problem while 'reloading' a page with different route params not making the server to be hit
This commit is contained in:
@@ -6,10 +6,14 @@ import './ShortUrls.scss';
|
||||
import ShortUrlsList from './ShortUrlsList';
|
||||
|
||||
export function ShortUrls(props) {
|
||||
const { match: { params } } = props;
|
||||
// Using a key on a component makes react to create a new instance every time the key changes
|
||||
const urlsListKey = `${params.serverId}_${params.page}`;
|
||||
|
||||
return (
|
||||
<div className="short-urls-container">
|
||||
<div className="form-group"><SearchBar /></div>
|
||||
<ShortUrlsList {...props} shortUrlsList={props.shortUrlsList.data || []} />
|
||||
<ShortUrlsList {...props} shortUrlsList={props.shortUrlsList.data || []} key={urlsListKey} />
|
||||
<Paginator paginator={props.shortUrlsList.pagination} serverId={props.match.params.serverId} />
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user