Menu
×
×
正确
function Person(props) {
return <h2>I'm { props.name }!</h2>;
}
function Greeting() {
const name = "Jesse"
return (
<>
<h1>Hello!</h1>
<Person name=@(1) name @(1) />
</>
);
}
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(<Greeting />);
function Person(props) {
return <h2>I'm { props.name }!</h2>;
}
function Greeting() {
const name = "Jesse"
return (
<>
<h1>Hello!</h1>
<Person name={ name } />
</>
);
}
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(<Greeting />);
不正确
点击 此处 重试 正确
下一题 ❯function Person(props) { return <h2>I'm { props.name }!</h2>; } function Greeting() { const name = "Jesse" return ( <> <h1>Hello!</h1> <Person name=w3exercise_input_no_0namew3exercise_input_no_1/> </> ); } const root = ReactDOM.createRoot(document.getElementById('root')); root.render(<Greeting />); |