jcmcneal / react-step-wizard

A modern flexible step wizard component built for React.
MIT License
580 stars 126 forks source link

UI flicker of second step on page load #93

Open KhalidH82 opened 2 years ago

KhalidH82 commented 2 years ago

I have an issue when my page loads the second step flickers quickly at the bottom. I'm using Next.js and wonder if this may be causing the issue? Thanks in advance for your help!

https://user-images.githubusercontent.com/33522107/135657827-7c8f524d-b219-42fc-9d0d-f9385dd7fe31.MOV

bundit commented 2 years ago

@KhalidH82 Do you have a reproducible codesandbox?

I also recommend trying a next production build and testing there as the dev environment can be flakey

noahhai commented 1 year ago

@KhalidH82 I fixed this issue. I cannot remember 100% what my fix was but I think it may have been this:

const Home: NextPage<Props> = (props) => {
    ...
    const [isSSR, setIsSSR] = useState(true);

    useEffect(() => {
        setIsSSR(false);
    }, []);

    ...
    return (!isSSR && 
            (
                 <StepWizard
                 .....
craigwi commented 8 months ago

I used https://stackoverflow.com/a/57173209/10834037 which has the same effect.