react-insta-stories
react-insta-stories copied to clipboard
Redirection on See more
Currently, seeMore can load a new component. Is there a way to redirect to a new url on click of seemore?
Currently, seeMore can load a new component. Is there a way to redirect to a new url on click of seemore?
I am also facing similar issue while redirection. @mohitk05 can you please help us with it? Thanks in advance. :)
One way to solve it using a thunk:
const seeMoreFactory = (url) => {
return ({close}) => {
close()
window.open(url, '_blank')
return null
}
}
const stories = data.map(story => ({
url: story.image,
type: 'image',
seeMore: seeMoreFactory(story.link)
}))
const App = () => (
<Stories
stories={stories}
/>
)
AWESOME Imerica