influxdata / influxdata/clockface

Improve className typing

Open
#128 0 comments 0 reactions 0 assignees View on GitHub
Low Priority tech debt
Dominant language
TypeScript
Stars
46
Forks
18
Avg merge
2d 7h
Merged PRs (30d)
1

Description

Currently all components have `className` typed as `string | undefined` since it is an optional prop with no default. To deal with this we are coercing `className` to be strict string via: ```[`${className}`]: className```

the `classnames` library can print the value of `className` like so: `[className]: className` however it requires that `className` be strictly `string` type to use that syntax.

If we change `className` to not be optional and have a default value of `''` the type would be just `string` and we could use the simpler syntax in `classnames` function calls

Contributor guide

Open the contributing guide

Research direction

Review the component prop definitions and the existing classnames call sites that coerce className with template literals. Determine how each component supplies a default empty string and confirm the className type remains consistent across components. Update the affected usage and verify that TypeScript checks pass without the coercion.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.