So there’s Button.js
in exercise 9/13 and it just imports:
import React from 'react';
but we also modify the code to use {this.props.talk}
for an onClick
event.
Why don’t I have to import Talker.js
where props.talk
is defined?
Talker.js
, however imports Button:
import { Button } from './Button';
I thought in order to use something you need to 1) export and 2nd) import it in each file?