Skip to content

Discovery - revisit any usage and conditional string | string[] | null prop types #388

Description

@ericdrosas87

After bumping to React v19, this conditional typing in this component had to change to this non-conditional typing. The usage for the former conditional typing was sprinkled throughout the codebase and typing issues ensued moving to the latter non-conditional typing. This mostly was an easy fix, but the ColorTool required temporary any typing usage to unblock the dev group in order to hit a Hazardous Asteroids milestone.

Several things need to be sussed out:

  1. Why was the conditional typing implemented in the first place? What problem did it solve and why weren't two wholly separate components created? Or why wasn't an interface used with an override for the use case where the string[] was used?
  2. Should the SelectListBox be redesigned to be not as flexible as in the past? My gut feel is yes, this would provide a consistent solution across the monorepo, but would also likely require the creation of a new component with an interface type that overrides the string to string[] type
  3. Should we keep the original string | string[] | null typing? Following the stack through the errors leads to web APIs that don't accept string[] - what do we do here?

This is a non-blocking issue and using any was intentionally a temporary solution, but we should be wary of any any usage and use it as sparingly as possible.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions