How to use @react-spring/core - 7 common examples

To help you get started, we’ve selected a few @react-spring/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github react-spring / react-spring / targets / zdog / src / globals.ts View on Github external
import { Anchor, invalidate, applyProps, addEffect } from 'react-zdog'
import { Globals, FrameLoop, update } from '@react-spring/core'
import { createStringInterpolator } from 'shared/stringInterpolation'
import colorNames from 'shared/colors'

// Add the update function as a global effect to react-zdog's update loop
if (addEffect) addEffect(update)

Globals.assign({
  defaultElement: Anchor,
  frameLoop: addEffect && new FrameLoop({ requestFrame: invalidate }),
  applyAnimatedValues: applyProps,
  createStringInterpolator,
  colorNames,
})
github react-spring / react-spring / targets / three / src / globals.ts View on Github external
import { invalidate, applyProps, addEffect } from 'react-three-fiber'
import { Globals, FrameLoop, update } from '@react-spring/core'
import { createStringInterpolator } from 'shared/stringInterpolation'
import colorNames from 'shared/colors'

// Add the update function as a global effect to react-three-fibers update loop
if (addEffect) addEffect(update)

Globals.assign({
  defaultElement: 'group',
  frameLoop: addEffect && new FrameLoop({ requestFrame: invalidate }),
  applyAnimatedValues: applyProps,
  createStringInterpolator,
  colorNames,
})
github react-spring / react-spring / targets / zdog / src / globals.ts View on Github external
import { Anchor, invalidate, applyProps, addEffect } from 'react-zdog'
import { Globals, FrameLoop, update } from '@react-spring/core'
import { createStringInterpolator } from 'shared/stringInterpolation'
import colorNames from 'shared/colors'

// Add the update function as a global effect to react-zdog's update loop
if (addEffect) addEffect(update)

Globals.assign({
  defaultElement: Anchor,
  frameLoop: addEffect && new FrameLoop({ requestFrame: invalidate }),
  applyAnimatedValues: applyProps,
  createStringInterpolator,
  colorNames,
})
github react-spring / react-spring / targets / three / src / globals.ts View on Github external
import { invalidate, applyProps, addEffect } from 'react-three-fiber'
import { Globals, FrameLoop, update } from '@react-spring/core'
import { createStringInterpolator } from 'shared/stringInterpolation'
import colorNames from 'shared/colors'

// Add the update function as a global effect to react-three-fibers update loop
if (addEffect) addEffect(update)

Globals.assign({
  defaultElement: 'group',
  frameLoop: addEffect && new FrameLoop({ requestFrame: invalidate }),
  applyAnimatedValues: applyProps,
  createStringInterpolator,
  colorNames,
})
github react-spring / react-spring / packages / addons / src / parallax.tsx View on Github external
() => ({
        config,
        busy: false,
        space: 0,
        current: 0,
        offset: 0,
        controller: new Controller({ scroll: 0 }),
        layers: new Set(),
        update: () => update(),
        scrollTo: offset => scrollTo(offset),
        stop: () => state.controller.stop(),
      }),
      []
github toofpaste / Invisible-Thread-Website / src / helpers / useYScroll.js View on Github external
  const [{ scrollSpring }, setScrollSpring] = useSpring(() => ({ scrollSpring: 0, config: config.molasses }));
github react-spring / react-spring / packages / addons / src / parallax.tsx View on Github external
({
    pages,
    config = configs.slow,
    enabled = true,
    horizontal = false,
    innerStyle,
    ...rest
  }: ParallaxProps) => {
    const [ready, setReady] = useState(false)

    let state: IParallax
    state = useMemoOne(
      () => ({
        config,
        busy: false,
        space: 0,
        current: 0,
        offset: 0,
        controller: new Controller({ scroll: 0 }),

@react-spring/core

The platform-agnostic core of `react-spring`

MIT
Latest version published 3 months ago

Package Health Score

94 / 100
Full package analysis