-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix reload crash on /searched #1744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add routing for search word: - `/searched/:searchword` Restore the state from the `:searchword` params.
| const { params } = this.props | ||
| const searchWord = params.searchword | ||
| if (searchWord !== undefined) { | ||
| this.setState({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restore search state from /searched/:searchword
| }) | ||
| router.push('/searched') | ||
| const keyword = this.refs.searchInput.value | ||
| router.push(`/searched/${encodeURIComponent(keyword)}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
push to /searched/:searchword
| <Route path='starred' /> | ||
| <Route path='searched' /> | ||
| <Route path='searched'> | ||
| <Route path=':searchword' /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/searched/:searchword
| } | ||
|
|
||
| if (location.pathname.match(/\/searched/)) { | ||
| const searchInputText = document.getElementsByClassName('searchInput')[0].value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the crash reason #1743
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution:+1:
LGTM:smile:
This PR fix reloading creash on
/searched#1743Add routing for search word:
/searched/:searchwordRestore the state from the
:searchwordparams.fix #1743