Skip to content

Conversation

@azu
Copy link
Contributor

@azu azu commented Mar 24, 2018

This PR fix reloading creash on /searched #1743

Add routing for search word:

  • /searched/:searchword

Restore the state from the :searchword params.

3 -25-2018 00-36-37

fix #1743

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({
Copy link
Contributor Author

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)}`)
Copy link
Contributor Author

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' />
Copy link
Contributor Author

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
Copy link
Contributor Author

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

@azu azu changed the title fix: fix reload crash on /searched fix reload crash on /searched Mar 24, 2018
@Rokt33r Rokt33r self-requested a review March 25, 2018 15:51
@Rokt33r Rokt33r added the awaiting review ❇️ Pull request is awaiting a review. label Mar 25, 2018
@sosukesuzuki sosukesuzuki self-requested a review March 31, 2018 04:14
Copy link
Member

@sosukesuzuki sosukesuzuki left a 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:

@sosukesuzuki sosukesuzuki removed the awaiting review ❇️ Pull request is awaiting a review. label Mar 31, 2018
@Rokt33r Rokt33r merged commit 5836b65 into BoostIO:master Mar 31, 2018
@azu azu deleted the search-routing branch April 2, 2018 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Search and Reload fail to reload

3 participants