-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Heading Component #9
Conversation
Hey, I noticed that you removed the test file and there are no tests for the Heading component, can you add some? |
Move Event Component into it's own directory
Remove Event Component and import it from Event directory
Hey @kevinfalting, am I just recovering the test file that I removed or making a new test for the heading component? |
Whatever you think would be best. I might start by using what was there, and potentially end up with something entirely different. Writing unit tests can be hard to wrap your head around, so it's something we can focus on when we meet again. 👌 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, great work 👍
Overview
Created directory
eventual/src/heading
with the fileeventual/src/heading/heading.tsx
which holds theHeading
component that takes a prop of title as a type of string. TheHeading
component is then used ineventual/src/App.tsx
that takes a hardcoded title prop. resolves #6Thought Process
At first I wrote the
Heading
component as it was taught here and it looked likefunction Heading({title}: {title: string;}) {return (<h1> { title } </h1>);}
I tested if a simple arrow function would work and it did and left it like that as it was less linesI decided to the take the prop typing and put them in an interface so it looks cleaner
Testing Steps
npm start
in the terminalHeading
title prop<Heading title="[ your sting here ]" />
Risks
Title prop is NOT optional and has to be specified. Has to be a type of string