form icon indicating copy to clipboard operation
form copied to clipboard

str.replaceAll is not a function on react-native (Android)

Open josej14 opened this issue 1 year ago • 1 comments

Describe the bug

When the app is opened on Android and the user reach a screen where tanstack-form is used the app crashes because str.replaceAll is being called when the form is mounted. str.replaceAll doesn't exist without hermes enabled on React-Native

Screenshot 2024-08-29 at 14 37 09

Your minimal, reproducible example

Didn't have time to prepare a working example for a React-Native app

Steps to reproduce

  1. FieldApi.update is being called on mount the form
  2. getBy is called where str.replaceAll is used
  3. The app crashes

Expected behavior

The app shouldn't crash, I fixed the problem with polyfill but I think you could probably easily change the use of replaceAll to avoid this Android issue

How often does this bug happen?

None

Screenshots or Videos

No response

Platform

  • OS: Android (React-Native)
  • Version: 0.29.2

TanStack Form adapter

None

TanStack Form version

v0.29.2

TypeScript version

No response

Additional context

No response

josej14 avatar Aug 29 '24 12:08 josej14

This is super helpful, thank you! We'll get this patched

crutchcorn avatar Sep 04 '24 20:09 crutchcorn

Sorry for how long this took - should be fixed now!

crutchcorn avatar Feb 21 '25 15:02 crutchcorn