Skip to content

refactor: clean up types in DAUChart #4737

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

Merged
merged 2 commits into from
Oct 24, 2022
Merged

refactor: clean up types in DAUChart #4737

merged 2 commits into from
Oct 24, 2022

Conversation

jsjoeio
Copy link
Contributor

@jsjoeio jsjoeio commented Oct 24, 2022

This cleans up some types in DAUChart.tsx. Previously, we were
type-casting which can lead to errors in production.

This cleans up some types in `DAUChart.tsx`. Previously, we were
type-casting which can lead to errors in production.
@jsjoeio jsjoeio requested a review from ammario October 24, 2022 22:28
@jsjoeio jsjoeio self-assigned this Oct 24, 2022
@@ -71,7 +71,7 @@ export const DAUChart: FC<DAUChartProps> = ({
defaults.font.family = theme.typography.fontFamily as string
defaults.color = theme.palette.text.secondary

const options = {
const options: ChartOptions<'line'> = {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested by docs to infer the correct options

@@ -119,16 +119,13 @@ export const DAUChart: FC<DAUChartProps> = ({
{
label: "Daily Active Users",
data: data,
lineTension: 1 / 4,
tension: 1 / 4,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure if typo or API change but this matches the types and what you see in Chart.js docs

@jsjoeio jsjoeio marked this pull request as ready for review October 24, 2022 22:34
@jsjoeio jsjoeio requested a review from a team as a code owner October 24, 2022 22:34
@jsjoeio jsjoeio requested review from presleyp and removed request for a team October 24, 2022 22:34
@jsjoeio jsjoeio enabled auto-merge (squash) October 24, 2022 23:15
@jsjoeio jsjoeio merged commit f9c6220 into main Oct 24, 2022
@jsjoeio jsjoeio deleted the jsjoeio/update-dau-chart branch October 24, 2022 23:28
@github-actions github-actions bot locked and limited conversation to collaborators Oct 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants