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

151
Views
Estoy intentando Reast React-Select's AsyncSelect desde un componente principal (https://react-select.com/home)

Estoy tratando de restablecer AsyncReact ( https://react-select.com/home ) desde un componente principal (ganchos), pero parece que no puedo hacerlo funcionar. Cualquier ayuda muy apreciada.

Puedo restablecerlo desde dentro del componente configurando el estado en una matriz vacía, pero parece que no puedo restablecerlo desde afuera.

Componente principal

 const MessengerMessagesTwo = ({ props }) => { const orgSearchRef = useRef(null); const handleClearOrgSearch = () => { orgSearchRef.current.clearValue(); } return <div> <button onClick={() => handleClearOrgSearch()}>clear</button> <MessengerMessagesTwoOrgSearch ref={orgSearchRef} /> </div> })

Componente hijo

 const MessengerMessagesTwoOrgSearch = forwardRef(({props}, ref) => { const [inputValue, setInputValue] = useState([]); useEffect(() => { setInputValue([]); return () => { setInputValue([]); // reset orgs selected handleOrgSelectedCallback([]); } }, []) return <div> <AsyncSelect isClearable defaultOptions placeholder="Search Orgs" loadOptions={loadOptions} onInputChange={handleInputChange} onChange={handleChange} isMulti noOptionsMessage={i => "Search..."} ref={ref} /> </div> }) const mapStateToProps = (state) => { return { }; }; const mapDispatchToProps = (dispatch) => { return { }; }; export default connect(mapStateToProps, mapDispatchToProps, null, {forwardRef: true})(MessengerMessagesTwoOrgSearch);
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Parece estar funcionando ahora. No cambió nada, y estoy muy confundido.

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!