+ 1
Wrong exercise options
The exercise What is the output of this code? function Test(props) { return <p>{"A"+props.title}</p>; } const el = <Test title="X" />; ReactDOM.render( el, document.getElementById('root') ); the output on stack blitz is "A", not AX - as the answer suggests. As the code is compiled it gives an error of undefined variable. So by deleting the A from the line return <p>{"A"+props.title}</p>; . Substitute X by A or vice versa in the const el, and it works.
2 Antworten
+ 4
I get AX on StackBlitz using the code you pasted from the lesson.