-
Notifications
You must be signed in to change notification settings - Fork 45
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
Chantelle | Edges | Inspiration Board #36
base: master
Are you sure you want to change the base?
Conversation
Inspiration BoardWhat We're Looking For
|
|
||
this.state = { | ||
cards: [], | ||
url: this.props.url, | ||
boardName: this.props.boardName, |
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.
You should only include things in state
if they're going to change as your application runs. As far as I can tell url
and boardName
don't change, which means it would be clearer to leave them in props
let URL = `${this.state.url}boards/${this.state.boardName}cards`; | ||
|
||
axios.post(URL, cardObj) | ||
.then((response) => { |
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.
I like that you've kept all the API interaction logic in one place - the callbacks are a little more complex, but I would say it makes the app as a whole much easier to comprehend. Whether or not you intended it, this is a great example of the container component pattern well-applied.
const Card = (props) => { | ||
|
||
const { text, emoji, id, deleteCardCallback} = props; | ||
|
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.
I like that you converted this to a functional component!
Inspiration Board
Congratulations! You're submitting your assignment!
Comprehension Questions