Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

79
Vistas
React JS auto complete functions

I am creating a reactJS webapp that has many different functional components, each functional component has some props and it is hard to keep track of what each functions takes in as props. Is there a way to suggest props in the compiler?

I've tried searching this issue to no avail

this is an example code

// creating a custom functional components
import React from "react";
import "./FadedText.scss";
export default function FadedText(props) {
  return <p className="fadedText">{props.text ?? "Faded text"}</p>;
}

and inside another file I want to

import React from "react"
import FadedText from "./FadedText"

function SomeName()=>
{
// Suggests a prop called text inside of FadedText for it to be given a value when I click 
// Ctrl+space
 return <FadedText >;
}

So when I import them the props names are suggested by the compiler. Is there a way to achieve this?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Try this below code in child component

     const {useCallback, useEffect} = React;

     const handleKeyPress = useCallback((event) => {
        console.log(`Key pressed: ${event.key}`);
        console.log(props)
      }, []);
      
        useEffect(() => {
        // attach the event listener
        document.addEventListener('keyup', handleKeyPress);
      }, [handleKeyPress]);

For control and space you may have to write logic like to store first key up of value and second key up of value... When both first and second is sequential to met ctrl + space you can trigger console.log(props)

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda