SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

0 0 0 C++

Fix maxLength default value when null is passed (#53273)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53273

In [c5956da8c0](https://github.com/facebook/react-native/commit/c5956da8c0b735d47761af51019ed25b49001c00) we landed a change of the default value of `maxLength`.

While doing that, we missed the case where the app is explicitly passing `null` for a value for `maxLength`. When this happens, the props parsing was initializing the `maxLength` to 0, making not possible to input any value.

This change fixes the issue by ensuring that the default value set when `null` is consistent with the default value when nothing is passed.

## Changelog:
[iOS][Fixed] - Fixed TextInput behavior when `maxLength={null}` is passed

Reviewed By: GijsWeterings

Differential Revision: D80255637

fbshipit-source-id: a0d1956e1d51dbfedd27dafabf60ffa9344358d3
R
Riccardo Cipolleschi committed
56ad53cb14b5c842714fcf976b6ba81f68c140f2
Parent: d2df64d
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> on 8/14/2025, 3:43:04 PM