react icon indicating copy to clipboard operation
react copied to clipboard

Utils should be exported

Open keithamus opened this issue 1 year ago • 1 comments

Problem statement

Right now many consumers use our utils functions. They do so because the utils are available, but not via a nice path.

For example this search (employees only) shows a few callsites of people importing ForwardRefComponent and useIsomorphicLayoutEffect.

Proposed solution

We expose utils as a proper path, with re-exports, so one can write, for example:

import type {ForwardRefComponent} from '@primer/react/utils'

as opposed to the current:

import type {ForwardRefComponent} from '@primer/react/lib-esm/utils/polymorphic'

keithamus avatar Apr 15 '24 15:04 keithamus

👋 Hi, I noticed the associated PR for this issue was closed in favor of #4513. Does that resolve this issue, or is there more work to be discussed here?

lesliecdubs avatar Aug 27 '24 18:08 lesliecdubs