Skip to content

Commit

Permalink
go to first section when reset
Browse files Browse the repository at this point in the history
  • Loading branch information
darioscrivano committed Aug 18, 2020
1 parent 184a2a5 commit 6bf813d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nanlabs/questionnaire",
"version": "1.0.13",
"version": "1.0.14",
"description": "Made with create-react-library",
"author": "Kupuka-D",
"license": "MIT",
Expand Down
6 changes: 5 additions & 1 deletion src/components/Questionnaire.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ export const Questionnaire = ({

useEffect(() => {
setFirstQuestion()
}, [reset])
dispatch({
type: 'setCurrentSection',
payload: dataProvider.getSections()[0]
})
}, [reset, dispatch, dataProvider])

useEffect(() => {
dispatch({ type: 'setDataProvider', payload: dataProvider })
Expand Down

0 comments on commit 6bf813d

Please sign in to comment.