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

62
Views
¿Cómo puedo empujar a los niños en estado de objeto? Quiero agregar niños en cualquier lugar fuera del árbol donde la clave principal coincida
const [treeData, setTreeData] = useState([ { title: 'parent 1', key: '0-0', icon: <UserAddOutlined />, children: [ { title: 'parent 1-0', key: '0-0-0', icon: <UserAddOutlined />, children: [ { title: 'leaf', key: '0-0-0-0', icon: <UserAddOutlined />, }, { title: 'leaf', key: '0-0-0-1', icon: <UserAddOutlined />, }, ], }, { title: 'parent 1-1', key: '0-0-1', icon: <UserAddOutlined />, children: [ { title: 'sss', key: '0-0-1-0', icon: <UserAddOutlined />, }, ], }, ], }, ]); const insertDataHandler = (formData) =>{ // i need to add this element on specific parent's children list const parentId = formData.pId; let element = { title: formData.nNode, key: formData.Id, icon: <UserAddOutlined />, } }

en insertDataHandler se creó el elemento, y también tengo una identificación principal, por lo que lo que debo hacer es que la identificación principal verifique todas las claves de treeData y las agregue a la matriz de elementos secundarios de este elemento principal específico donde la clave coincide, si los elementos secundarios no existen luego crea la matriz y luego inserta en esa matriz

about 4 years ago · Juan Pablo Isaza
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!