Skip to content
This repository has been archived by the owner on Dec 14, 2020. It is now read-only.

iFwu/prefresh-bugs-reproduce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

prefresh-bugs-reproduce

For @prefresh/nollup and @prefresh/snowpack

useEffect callback changes not trigger refresh

In preact-nollup/src/Counter.js or preact-snowpack/src/Counter.js:

useEffect(() => {
    let interval = setInterval(() => {
        setCount(c => c + 1);
    }, 200);

    return () => {
        clearInterval(interval)
    };
}, []);

Changing codes in useEffect not triggers refresh. e.g. Change interval time, the counter still use the old value. Or even comment all lines in the useEffect callback, the counter still goes on.

For @prefresh/snowpack

changing a component then changing another component using it causes unexpected behavior

Chang preact-snowpack/src/Counter.jsx to:

import './Counter.css';

export default function Counter () {
    return <div class="Counter">----</div>
}

Change preact-snowpack/src/Internal.jsx to:

import Counter from './Counter';

export const Internal = () => (
  <div>
    Test
    <Counter />
  </div>
);

And you can see the Counter component above reverted to the previous state. And the subsequent changes to Counter will only affect the one below.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published