Skip to content

Commit 3f9e2eb

Browse files
committed
Move away from depreciated staggerChildren to delayChildren instead
See documentation https://motion.dev/docs/react-transitions#delaychildren
1 parent a5c4266 commit 3f9e2eb

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

code/26 Animations/06-animating-staggered-lists/src/components/NewChallenge.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useContext, useRef, useState } from 'react';
2-
import { motion } from 'framer-motion';
2+
import { motion, stagger } from 'framer-motion';
33

44
import { ChallengesContext } from '../store/challenges-context.jsx';
55
import Modal from './Modal.jsx';
@@ -57,10 +57,10 @@ export default function NewChallenge({ onDone }) {
5757
<input ref={deadline} type="date" name="deadline" id="deadline" />
5858
</p>
5959

60-
<motion.ul
61-
id="new-challenge-images"
60+
<motion.ul
61+
id="new-challenge-images"
6262
variants={{
63-
visible: { transition: { staggerChildren: 0.05 } }
63+
visible: { transition: { delayChildren: stagger(0.05) } }
6464
}}>
6565
{images.map((image) => (
6666
<motion.li

code/26 Animations/07-animating-colors-and-keyframes/src/components/NewChallenge.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useContext, useRef, useState } from 'react';
2-
import { motion } from 'framer-motion';
2+
import { motion, stagger } from 'framer-motion';
33

44
import { ChallengesContext } from '../store/challenges-context.jsx';
55
import Modal from './Modal.jsx';
@@ -60,7 +60,7 @@ export default function NewChallenge({ onDone }) {
6060
<motion.ul
6161
id="new-challenge-images"
6262
variants={{
63-
visible: { transition: { staggerChildren: 0.05 } },
63+
visible: { transition: { delayChildren: stagger(0.05) } },
6464
}}
6565
>
6666
{images.map((image) => (

code/26 Animations/08-imperative-animations/src/components/NewChallenge.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export default function NewChallenge({ onDone }) {
6868
<motion.ul
6969
id="new-challenge-images"
7070
variants={{
71-
visible: { transition: { staggerChildren: 0.05 } },
71+
visible: { transition: { delayChildren: stagger(0.05) } },
7272
}}
7373
>
7474
{images.map((image) => (

code/26 Animations/09-animating-layout-changes/src/components/NewChallenge.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export default function NewChallenge({ onDone }) {
6868
<motion.ul
6969
id="new-challenge-images"
7070
variants={{
71-
visible: { transition: { staggerChildren: 0.05 } },
71+
visible: { transition: { delayChildren: stagger(0.05) } },
7272
}}
7373
>
7474
{images.map((image) => (

code/26 Animations/10-orchestrating-multi-element-animations/src/components/NewChallenge.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export default function NewChallenge({ onDone }) {
6868
<motion.ul
6969
id="new-challenge-images"
7070
variants={{
71-
visible: { transition: { staggerChildren: 0.05 } },
71+
visible: { transition: { delayChildren: stagger(0.05) } },
7272
}}
7373
>
7474
{images.map((image) => (

code/26 Animations/11-animating-shared-elements/src/components/NewChallenge.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export default function NewChallenge({ onDone }) {
6868
<motion.ul
6969
id="new-challenge-images"
7070
variants={{
71-
visible: { transition: { staggerChildren: 0.05 } },
71+
visible: { transition: { delayChildren: stagger(0.05) } },
7272
}}
7373
>
7474
{images.map((image) => (

code/26 Animations/12-finished/src/components/NewChallenge.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export default function NewChallenge({ onDone }) {
6868
<motion.ul
6969
id="new-challenge-images"
7070
variants={{
71-
visible: { transition: { staggerChildren: 0.05 } },
71+
visible: { transition: { delayChildren: stagger(0.05) } },
7272
}}
7373
>
7474
{images.map((image) => (

0 commit comments

Comments
 (0)