UNPKG

framer-motion

Version:

An open source and production-ready motion library for React on the web

14 lines (9 loc) • 310 B
export function shallowCompare(next: any[], prev: any[] | null) { if (!Array.isArray(prev)) return false const prevLength = prev.length if (prevLength !== next.length) return false for (let i = 0; i < prevLength; i++) { if (prev[i] !== next[i]) return false } return true }