Skip to content
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

Implementation of placeToString #24

Open
chrispiccaro18 opened this issue Apr 30, 2020 · 1 comment
Open

Implementation of placeToString #24

chrispiccaro18 opened this issue Apr 30, 2020 · 1 comment

Comments

@chrispiccaro18
Copy link

Thanks for making this tutorial! I have a clarification question on the implementation of placeToString regarding the property, place, being optional. When following along I'm getting an error regarding a Todo that doesn't have the optional place prop: Argument of type '{ custom: string; } | "home" | "work" | undefined' is not assignable to parameter of type 'Place'. Type 'undefined' is not assignable to type 'Place'.

Would we need to add that Place can also be undefined? or when using the function, placeToString, would you first filter out the todos that don't have place?

@kartk
Copy link

kartk commented Jul 27, 2020

Your second approach of filtering out the todos that don't have a place seems ideal in this case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants