Skip to content

Commit

Permalink
fix: remove useEffect reset
Browse files Browse the repository at this point in the history
This will allow useGuide to be used across nested levels of components
  • Loading branch information
dominictwlee committed Apr 20, 2020
1 parent d3af648 commit 3d4f3fd
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/useGuide.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useEffect } from 'react';
import TourguideContext from './TourguideContext';
import { useContext } from 'react';

Expand All @@ -9,13 +8,5 @@ export default function useGuide() {
throw new Error('useGuide must be used within TourguideProvider');
}

const { reset } = guideContext;

useEffect(() => {
return () => {
reset();
};
}, [reset]);

return guideContext;
}

0 comments on commit 3d4f3fd

Please sign in to comment.