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

Abierto
#707 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
66/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
react, typescript
Área
frontend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
TypeScript
Estrellas
4
Forks
0
Merge medio
16 h 28 min
PR fusionados (30 d)
9

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de qoretechnologies/reqore

Todos los issues de qoretechnologies/reqore

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.