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

setTextRunValue crashes app on iOS simulator

Open
#275 1 comment 3 reactions 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

"expo": "~51.0.28"
"react-native": "0.74.5"
"rive-react-native": "8.1.0"

-->

Description

When trying to set a text run value the app on iOS crashes. Android works just fine.

Provide a Repro
interface IBadge {
  value?: string;
}

export const Badge = ({ value }: IBadge) => {
  const riveRef = React.useRef<RiveRef>(null);

  useEffect(() => {
    riveRef.current?.setTextRunValue("amount", value ?? " ");
  }, [value]);

  return (
      <Rive
        artboardName="badge"
        stateMachineName="main"
        ref={riveRef}
        autoplay
        url={`https://public.rive.app/community/runtime-files/13780-27374-toptop-badge.riv`}
      />
  );
};
Source .riv/.rev file

toptop_-_badge.riv.zip

Expected behavior

Rive component should update text run value without crashing an app.

Screenshots
Screenshot 2024-11-16 at 22 48 51 Screenshot 2024-11-16 at 22 48 57
Device & Versions (please complete the following information)
  • Device: iOS Simulator
  • OS: iOS 16.4
  • NPM Version: 10.8.1
Additional context

I made sure my text run value has a custom name "amount" and it's exported

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

Start by running the provided Badge reproduction with Expo ~51.0.28, React Native 0.74.5, and rive-react-native 8.1.0 on the iOS 16.4 simulator, then trace the setTextRunValue call from the Rive ref. Use the attached .riv file to reproduce the crash; done means updating the "amount" text run without crashing while Android behavior remains intact.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.