rive-app / rive-app/rive-react-native

Animation is not smooth on first fire

Open
#144 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
783
Forks
81
Avg merge
3d 6h
Merged PRs (30d)
3

Description

Description

I just installed the Rive to test it out on Android, it's working but not as expected.

So in Rive's Discord i found a dark mode switch project which is here
Dark mode switch

My knowledge about Rive is quite limited so simply i wanted to create a dark switch with a onPress event.

so when I press for first time the switch is switching but not with animation, after second click its starting to work as expected.


 <TouchableOpacity
          onPress={() => {
            setIsDark(!isDark);
            riveRef.current.setInputState("State Machine 1", "isDark", isDark);
          }}
          autoplay={true}
          style={{width: 100, height: 50}}
        >
          <Text>FIRE</Text>
        </TouchableOpacity>
        <Rive
          ref={riveRef}
          resourceName="dark"
          style={{width: "100%", height: 40}}
          autoplay={false}
        />

https://user-images.githubusercontent.com/44513402/192143445-b4ec20f8-dc09-4878-8501-b5eca44d1af4.mov

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The report names no source file or test. Start by reproducing the provided React Native example and compare the first and second calls to setInputState; done means the first press triggers the dark-mode animation as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native, typescript
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.