dispatch(routerRedux.push({
pathname: location.pathname,
query: {
...value,
searchTags:tags,
page: 1,
pageSize,
},
}))
์ฌ๊ธฐ์ searchTags๋ ๋ฐฐ์ด์ด์ง๋ง ์์ ์ฐ๊ธฐ ๋ฐฉ๋ฒ์ผ๋ก๋ ๊ฒฐ๊ณผ๋ฅผ ์ ๋๋ก ์ป์ ์ ์์ต๋๋ค. URL์ ๋งค๊ฐ ๋ณ์๋ searchTags = XXX๋ก ํ์๋ฉ๋๋ค. url ๋งค๊ฐ ๋ณ์๋ฅผ searchTags [] = XXX๋ก ๋ณ๊ฒฝํ๋ฉด ์ฌ๋ฐ๋ฅธ ๊ฒฐ๊ณผ๋ฅผ ์ป์ ์ ์์ต๋๋ค. ์ฟผ๋ฆฌ์์ ๋ฐฐ์ด ๋งค๊ฐ ๋ณ์ ์ ์ What?searchTags [] : tags๋ก ๋ณ๊ฒฝํ๋ ค๊ณ ํ์ง๋ง ํ๋ก๊ทธ๋จ์์ ์ค๋ฅ๋ฅผ๋ณด๊ณ ํ์ต๋๋ค.
์์ค ์ฝ๋๋ฅผ ๋ณด๋ฉด query-string์ผ๋ก ์ด์ค์ผ์ดํ๋์ง๋ง ๋ฐฐ์ด์ด ์ง์๋๋์ง ์ฌ๋ถ๋ ๋ช ํํ์ง ์์ต๋๋ค. https://github.com/ReactTraining/history/blob/44bc923/modules/useQueries.js#L9 -L11
์ฟผ๋ฆฌ ๋ฌธ์์ด์ ์ฌ์ฉํ์ฌ ์ง์ ๋ค์ ๊ฒ์ ํ ์ ์์ต๋๋ค.
์๋
ํ์ธ์.
์ฌ์ฉํ ์ ์์ต๋๋ค
// ่ทณ่ฝฌ
this.props.dispatch(routerRedux.push({
pathname: '',
state: { searchTags: [] },
}));
// ่ทๅ
this.props.location.state;
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
์๋ ํ์ธ์.
์ฌ์ฉํ ์ ์์ต๋๋ค