Question Bank
/

React Component Communication Quiz

React Component Communication Quiz

Four quick checks on how React components pass data down via props and notify parents via callbacks, plus when render-props become a better tool than another layer of props.

Question Bank
Easy
JavaScript
4 questions
quiz
react
hooks
fundamentals

208 views

1

Pass a label and an onClick callback into the IconButton below from a parent. Then call it from Toolbar with two different labels.

function IconButton({ label, onClick }) {
    return (
        <button type="button" onClick={onClick}>
            {label}
        </button>
    );
}