jaredLunde / jaredLunde/snowpack-plugin-svgr

React.RefForwardingComponent deprecated

Open
#6 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
18
Forks
4
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
The custom type suggested:
```ts
declare module '*.svg' {
const ref: React.RefForwardingComponent<
SVGSVGElement,
React.SVGAttributes
>
export default ref
}
```
Uses the deprecated property `RefForwardingComponent`.

**Expected behavior**
I'm not sure what the proper replacement/migration is.

Contributor guide

Open the contributing guide

Research direction

Start with the custom TypeScript declaration for '*.svg' shown in the issue and review React's replacement for the deprecated RefForwardingComponent type. Confirm the supported migration and update the declaration so SVG imports no longer use the deprecated property; done means the suggested type compiles without that deprecation.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.