Open pr0kc opened 2 years ago
i had the same problem in my nuxtjs project, i think you need to import the locomotive-scroll.css
in your App.js and maybe it will work
when I import an error like this appears Module not found: Error: Can't resolve 'locomotive-scroll.css'
how to import it like this, isn't it?
import 'locomotive-scroll.css'
try this import "locomotive-scroll/dist/locomotive-scroll.css";
it showing me blank screen right now and also give bunch of error in inspect console
i think you need to create a locomitive-scroll.css
and call him to your app.js like this example:
https://stackblitz.com/edit/react-locoscroll?file=src%2FApp.js
just copy the locomitive-scroll.css
from this example and try it in you app šš¾
the last version of locomitive-scroll.css
https://github.com/locomotivemtl/locomotive-scroll/blob/master/dist/locomotive-scroll.css
it works, but the scroll keeps scrolling down
try this import locomotive-scroll/src/locomotive-scroll.scss
i don't know dude but this brings up another problem, now the scroll is to 2 and some of the html components are not visible, and when I click on one of the 1 component in the header it can't scroll up and can only go down continuously
and this is my header content
sorry dude for bothering you but I've tried to find a solution elsewhere, but didn't find the answer
import React, { useState } from 'react'
import './FirstPage.css'
import Bars from '../../images/bars.png'
import { Link } from 'react-scroll'
const FirstPage = () => {
const mobile1 = window.innerWidth<=540 ? true: false;
const [menuOpened, setMenuOpened] = useState(false)
return (
<div className="header">
<h2 className="logo"><Link
onClick={()=> setMenuOpened(false)}
activeClass="active"
to='home'
spy={true}
smooth={true}
>klaw.</Link></h2>
{menuOpened === false && mobile1 === true ? (
<div className="bars" style={{backgroundColor: "#555", padding: ".7rem", borderRadius: "5px",}} onClick={() => setMenuOpened(true)}>
<img src={Bars} style={{width: '1rem', height: '1rem'}}/>
</div>
) : (
<ul className="header-menu">
<li className="h"><Link
onClick={()=> setMenuOpened(false)}
activeClass="active"
to='home'
spy={true}
smooth={true}
>HOME</Link></li>
<li className="a"><Link
onClick={()=> setMenuOpened(false)}
activeClass="active"
to='about'
spy={true}
smooth={true}
>ABOUT</Link></li>
<li className="w"><Link
onClick={()=> setMenuOpened(false)}
activeClass="active"
to='works'
spy={true}
smooth={true}
>WORKS</Link></li>
<li className="c"><Link
onClick={()=> setMenuOpened(false)}
activeClass="active"
to='contact'
spy={true}
smooth={true}
>CONTACT</Link></li>
</ul>
)}
</div>
)
}
export default FirstPage
I am not sure if you solved you issue, but your tiket helped me to make the scolling work in my react application, so thank you!
does anyone know how to fix scrolls that are continuously downwards? even though it was fine before, I've tried to give the max height in the footer also stay the same. please help
this is the content of the App.js