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

99
Views
Quiero mostrar 2 animaciones de lottie diferentes, svg1 y svg2

Aquí está mi código, actualmente muestra svg1 dos veces. Quiero mostrar svg1 y svg2.

futuro quiero agregar más de 2 animaciones SVG. soy nuevo en reaccionar y lottie

 import React from 'react'; import Lottie from 'react-lottie'; import svg1 from '../../assets/svg/svg1'; import svg2 from '../../assets/svg/svg2'; export default function Landing() { const defaultOptions = { loop: true, autoplay: true, animationData: svg1, rendererSettings: { preserveAspectRatio: 'xMidYMid slice', }, }; return ( <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}> <h1>Landing Page</h1> <Lottie options={defaultOptions} height={900} width={900} /> <Lottie options={defaultOptions} height={900} width={900} /> </div> ); }

Gracias

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Puede definir varias variables "defaultOptions" y usarlas en varios componentes de Lottie de la siguiente manera:

 export default function Landing() { const defaultOptions1 = { loop: true, autoplay: true, animationData: svg1, rendererSettings: { preserveAspectRatio: 'xMidYMid slice', }, }; const defaultOptions2 = { loop: true, autoplay: true, animationData: svg2, rendererSettings: { preserveAspectRatio: 'xMidYMid slice', }, }; return ( <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}> <h1>Landing Page</h1> <Lottie options={defaultOptions1} height={900} width={900} /> <Lottie options={defaultOptions2} height={900} width={900} /> </div> ); }
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!