Skip to content
Junior–Senior164 views

Creating a dynamic React component for greeting

Task condition

It is required to extract the line «Hello CodeSandbox» into a separate React component. The part of the text «CodeSandbox» should be passed to the component via a prop so that it can be changed each time it is used. Below is a basic template of the application from which you can start (feel free to rename the main component).

import "./styles.css";

export default function MainApp() {
  return (
    <div className="App">
      <h1>Hello CodeSandbox</h1>
      <h2>Start editing to see some magic happen!</h2>
    </div>
  );
}
Frontend tasks in the code trainer