First assignment with React

In the last few days I’ve been learning how to use react and finally got through some of the basics. After going through some of the basics I had to do a small assignment.

The instructions were:

  • Create TWO new components: UserInput and UserOutput
  • UserInput should hold an input element, UserOutput two paragraphs
  • Output multiple UserOutput components in the App component (any paragraph texts of your choice)
  • Pass a username (of your choice) to UserOutput via props and display it there
  • Add state to the App component (=> the username) and pass the username to the UserOutput component
  • Add a method to manipulate the state (=> an event-handler method)
  • Pass the event-handler method reference to the UserInput component and bind it to the input-change event
  • Ensure that the new input entered by the user overwrites the old username passed to UserOutput
  • Add two-way-binding to your input (in UserInput) to also display the starting username
  • Add styling of your choice to your components/ elements in the components – both with inline styles and stylesheets

I had a bit of problem passing properties to the components and adding styles with inline css styles. Since I’m still a bit new to React I had to keep going back to old code to remind myself how to do certain things. I did manage to fulfill all the instructions for the assignment

React assignment.

You may also like...

2 Responses

  1. RYAN SESLOW says:

    Great Work man! I love watching your growth! Your crushing it! Keep going!

Leave a Reply

Your email address will not be published. Required fields are marked *