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

230
Views
Reaccionar: no se pueden leer las propiedades de undefined (leyendo 'nombre de la ruta')

No entiendo por qué aparece el error. Mi tarea es hacer animación entre Rutas. ¿Puede sugerir dónde cometí un error? ingrese la descripción de la imagen aquí Uso el paquete react-spring, lo reinstalé pero nada ayudó

 import React from 'react'; import { Routes, Route, useLocation } from 'react-router-dom'; import { useTransition, animated } from 'react-spring' import Home from './Home/Home'; import Signup from './Form/Signup'; import Login from './Form/Login'; import Reset from './Form/Reset'; import Shop from './Shop/Shop'; import Dash from './../pages/Dashboard/Dashboard'; const Main = () => { const location = useLocation(); const transitions = useTransition(location, location => location.pathname, { from: { opacity: 0, transform: 'translate3d(100vw, 0, 0)' }, enter: { opacity: 1, transform: 'translate3d(0, 0, 0)' }, leave: { opacity: 0, transform: 'translate3d(-20vw, 0, 0)' }, }); return transitions.map(({ item: location, props, key }) => ( <> <animated.div key={key} style={props}> <Routes location={location}> <Route path='/' element={<Home/>} /> <Route exact path='/signup' element={<Signup/>}/> <Route exact path='/login' element={<Login/>}/> <Route exact path='/dashboard' element={<Dash/>}/> <Route exact path='/reset-password' element={<Reset/>}/> <Route exact path='/shop' element={<Shop/>}/> </Routes> </animated.div> </> )); }; export default Main;
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

De hecho, creo que esto se debe a que podría estar usando v9 o react-spring pero la sintaxis en la que está escribiendo es v8.

¿Esto resuelve tu problema?

 import React from 'react'; import { Routes, Route, useLocation } from 'react-router-dom'; import { useTransition, animated } from 'react-spring' import Home from './Home/Home'; import Signup from './Form/Signup'; import Login from './Form/Login'; import Reset from './Form/Reset'; import Shop from './Shop/Shop'; import Dash from './../pages/Dashboard/Dashboard'; const Main = () => { const location = useLocation(); const transitions = useTransition(location, { key: location => location.pathname, from: { opacity: 0, transform: 'translate3d(100vw, 0, 0)' }, enter: { opacity: 1, transform: 'translate3d(0, 0, 0)' }, leave: { opacity: 0, transform: 'translate3d(-20vw, 0, 0)' }, }); return transitions.map((props, location) => ( <> <animated.div style={props}> <Routes location={location}> <Route path='/' element={<Home/>} /> <Route exact path='/signup' element={<Signup/>}/> <Route exact path='/login' element={<Login/>}/> <Route exact path='/dashboard' element={<Dash/>}/> <Route exact path='/reset-password' element={<Reset/>}/> <Route exact path='/shop' element={<Shop/>}/> </Routes> </animated.div> </> )); }; export default Main;
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!