Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

84
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!