-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7860 from storybookjs/hooks-context
Core: Pass a separate hooks context per story
- Loading branch information
Showing
13 changed files
with
488 additions
and
338 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react'; | ||
import { useState } from '@storybook/client-api'; | ||
|
||
export default { | ||
title: 'Hooks', | ||
}; | ||
|
||
export const Checkbox = () => { | ||
const [on, setOn] = useState(false); | ||
return ( | ||
<label> | ||
<input type="checkbox" checked={on} onChange={e => setOn(e.target.checked)} /> | ||
On | ||
</label> | ||
); | ||
}; | ||
|
||
export const Input = () => { | ||
const [text, setText] = useState('foo'); | ||
return <input value={text} onChange={e => setText(e.target.value)} />; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.