-
Notifications
You must be signed in to change notification settings - Fork 15
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
feat: add list view prototype #6
Conversation
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.
Please always add a description to the PR.
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.
This is amazing! Thank you for your great work! I've added some pointers to help us have a bit more reusability.
@@ -0,0 +1,21 @@ | |||
import * as React from 'react'; |
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.
Normally, we don't need to do this. This should work just fine.
import * as React from 'react'; | |
import React from 'react'; |
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 had someone point this out to me once: facebook/react#18102
components/BookCard.tsx
Outdated
import * as React from 'react'; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-empty-interface | ||
interface BookCardProps {} |
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.
Let's remove this and add it once we need it. No premature code please.
Also, let's use type
s over interface
s.
Interfaces have stung me in the past in multiple ways. For example:
- You can declare the same
interface
multiple times and TS will just go with it and create some weird intersection. Alltype
names are expected to be unique like variables. - Interfaces are more common with OOP (
class Thing implements MyInterface
). I'd like this project to be more functional than object-oriented. - Interfaces and types are composable the same way, but types have unique constraints.
- VS Code only: when hovering on a type, you get a FULL DESCRIPTION of its schema. When hovering on an interface, you just see
interface MyInterface
without any idea what it actually is.
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.
We should add this to a wiki page, just in case :)
@@ -0,0 +1,77 @@ | |||
import * as React from 'react'; |
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.
See previous comment about the imports.
This PR adds a list view to the main page.