alvarotrigo / react-fullpage

Official React.js wrapper for fullPage.js https://alvarotrigo.com/react-fullpage/
GNU General Public License v3.0
1.29k stars 178 forks source link

I have an issue with scrollOverflowReset in nextjs #239

Closed lardi closed 3 years ago

lardi commented 3 years ago

Hi, I am working wit nextJs, and fullpage.scrollOverflowReset.min not work with my site

import OneNode from '../components/OneNode'
import ReactFullpage from '@fullpage/react-fullpage'

// const originalColors = ['#ff5f45', '#0798ec', '#fc6c7c', '#435b71', 'orange', 'blue', 'purple', 'yellow'];
const pluginWrapper = () => {
  require('../lib/fullpage.scrollOverflowReset.min')
}

const FullArticle = ({article}) => {

  const licenseKey= 'xxxxxxxxxxxx'

  return (
    // article.sort((a, b) => a.node_order - b.node_order).map( node => (
    //   <OneNode node={node} />
    // ))
    <div className="App">
    <ReactFullpage
      navigation
      licenseKey={licenseKey}
      pluginWrapper={pluginWrapper}
      scrollOverflowReset={true}
      render={comp =>
        console.log("render prop change") || (
          <ReactFullpage.Wrapper>
            {article.map(article => (
              <div key={article.title}  className="section">
                <OneNode node={article} />
              </div>
            ))}
          </ReactFullpage.Wrapper>
        )
      }
    />
  </div>

  )
}

export default FullArticle;
alvarotrigo commented 3 years ago

Check out the example. pluginWrapper is not needed for scrollOverflow: https://github.com/alvarotrigo/react-fullpage/blob/master/examples/next/pages/index.js

Make sure to use the latest version 0.1.19