I'm trying to create a React component that receive props that contains attribute message. The component renders text 'Too long' if the length of message value is greater than 10. Otherwise the message value is rendered.
my App.js code:
import React from 'react';
import './App.css';
function App(props) {
return (
<div className="App">
{props.message}
</div>
);
}
export default App;
index.js
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
ReactDOM.render(
<React.StrictMode>
<App message="Hello World"/>
</React.StrictMode>,
document.getElementById('root')
);
This is how the app should work: https://imgur.com/a/1LaQitZ I am not sure how to proceed.