This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//... | |
return ( | |
<div className="App"> // keep this div for styling later | |
<div onClick={() => animate()}> // here | |
<Lottie | |
options={options} | |
height={400} | |
width={400} | |
isClickToPauseDisabled={true} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from 'react'; | |
import Lottie from 'react-lottie-segments'; | |
import animationData from './lotties/toggle.json'; | |
import styles from './App.module.css'; | |
function App() { | |
const [sequence, setSequence] = useState({ // here | |
segments: [0, 1], | |
forceFlag: true | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//... | |
return ( | |
<div className="App"> | |
<Lottie | |
options={options} | |
height={400} | |
width={400} | |
isClickToPauseDisabled={true} // here | |
playSegments={sequence} // & here | |
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//... | |
return ( | |
<div className="App"> | |
<Lottie | |
options={options} | |
height={400} | |
width={400} | |
isClickToPauseDisabled={true} // here | |
playSegments={sequence} // & here | |
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function App() { | |
const options = { | |
loop: false, // here | |
autoplay: false, // & here | |
animationData: animationData, | |
rendererSettings: { | |
preserveAspectRatio: "xMidYMid slice" | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Lottie from 'react-lottie-segments'; | |
import animationData from './lotties/toggle.json'; | |
import './App.css'; | |
function App() { | |
const options = { | |
loop: true, | |
autoplay: true, | |
animationData: animationData, | |
rendererSettings: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Lottie from 'react-lottie-segments'; | |
import animationData from './lotties/toggle.json'; | |
import './App.css'; | |
function App() { | |
const options = { | |
}; | |
return ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Lottie from 'react-lottie-segments'; // here | |
import animationData from './lotties/toggle.json'; // here | |
import './App.css'; | |
function App() { | |
return ( | |
<div className="App"> | |
</div> | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import './App.css'; | |
function App() { | |
return ( | |
<div className="App"> | |
</div> | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const removeTodo = (i, checked) => { | |
if (checked) { | |
const newCompletedTodos = [...completedTodos]; | |
newCompletedTodos.splice(i, 1); | |
setCompletedTodos(newCompletedTodos); | |
} else { | |
const newTodos = [...todos]; | |
newTodos.splice(i, 1); | |
setTodos(newTodos); | |
} |