Skip to content
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

When using react-fullpage and ScrollToTopOnMount with react-router,the error is '[react-router] Location "/sectionTwo" did not match any routes' #52

Open
ZhouYajie opened this issue Dec 22, 2017 · 1 comment

Comments

@ZhouYajie
Copy link

Component's code is the same as the example of your Git ,and also add the ScrollToTopOnMount component.But the browser gives the error "[react-router] Location "/sectionTwo" did not match any routes".

`import React, { Component, PropTypes } from 'react'
import {ScrollToTopOnMount, SectionsContainer, Section} from 'react-fullpage';

export default class Cover extends Component {
constructor(props) {
super(props)
this.state = {
current: 0,
}
}
render() {
const options = {
sectionClassName: 'section',
anchors: ['sectionOne', 'sectionTwo', 'sectionThree'],
scrollBar: false,
navigation: true,
verticalAlign: false,
sectionPaddingTop: '50px',
sectionPaddingBottom: '50px',
arrowNavigation: true,
scrollCallback: (states) => this.setState({current: states.activeSection})
};

const {current} = this.state

return (
  <div className="container">
    <ScrollToTopOnMount />
    <SectionsContainer className="container" {...options}>
      <Section className="custom-section" verticalAlign="true" color="#69D2E7" activeSection={current}>Page 1</Section>
      <Section color="#A7DBD8">Page 2</Section>
      <Section color="#E0E4CC">Page 3</Section>
    </SectionsContainer>
  </div>
)

}
}`

@520Yanxiaofei
Copy link

你好,这个问题你解决了吗?我也遇到这个问题,挺烦恼,不知怎么解决

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

No branches or pull requests

2 participants