Skip to content

Commit 7fbef46

Browse files
AgentkmaKent C. Dodds
authored andcommitted
Fix fetch example (#225)
* added anonymous function to onClick call for fetchGreeting and passed in the url prop as an argument * revised so fetchGreeting does not need the url prop passed as an arg
1 parent ce1540a commit 7fbef46

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/react-testing-library/example-intro.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export default function Fetch({url}) {
122122
const {greeting, setGreeting} = useState('')
123123
const {buttonClicked, setButtonClicked} = useState(false)
124124

125-
const fetchGreeting = async url => {
125+
const fetchGreeting = async () => {
126126
const data = await fetch(url)
127127
const {greeting} = data
128128
setGreeting(greeting)

0 commit comments

Comments
 (0)