結果 : how to use useeffect inside a function