ReqoreLink forwards the isText styling prop to a custom 'as' element (React warning with react-router's Link)

Open
#707 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
66/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
react, typescript
Domain
frontend

Research direction

Start with ReqoreLink and trace how its isText styling prop is forwarded when a custom as element is used; the issue does not name the implementation or test files. Check the existing tests for custom as elements and run them before making a change. Done means styled-only props such as isText no longer reach the custom element or its DOM output, and the React warning is covered by a regression test.

Written by the indexing model from the issue text.

Description

What happens

ReqoreLink with a custom element, e.g. react-router's link:

<ReqoreLink as={Link} to="/blog/some-post" underline={false}>Title</ReqoreLink>

passes Reqore's internal isText styling prop through to the custom element. react-router's Link spreads unknown props onto its <a>, so React warns on every render:

Warning: React does not recognize the `isText` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `istext` instead.

Seen with @qoretechnologies/reqore 0.77.5 (beta), React 18, react-router-dom 6.

What the landing page needs

The qorus.cloud post cards (src/components/blog/PostCard.tsx in qorus-saas-landing) make the card's title a router link with ReqoreLink as={Link}, as the prop's docs suggest. isText (and any other styled-only prop) should be filtered with shouldForwardProp / a transient $ prop before it reaches a custom as element.

Meanwhile

The landing page wraps react-router's Link in a small adapter that drops isText, marked TODO(reqore) with this issue; it goes away once Reqore filters the prop.

Dominant language
TypeScript
Stars
4
Forks
0
Avg merge
16h 28m
Merged PRs (30d)
9

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from qoretechnologies/reqore

All issues in qoretechnologies/reqore

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.