You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After upgrading to 21.11.0, I got the TS error from my existing code:
Type '{ item_id: string; item_name: string; item_variant: string | undefined; }' is not assignable to type 'Item'.
Property 'item_variant' is incompatible with index signature.
Type 'string | undefined' is not assignable to type 'string | number'.
Type 'undefined' is not assignable to type 'string | number'.
This appears to be due to #7908 , meaning any provided Item fields are no longer allowed to be assigned undefined. Specifically, the variable I am assigning to item_variant has the type string | undefined (in my code).
Now, I could work around this by making a big conditional builder to only assign fields for which I have data, but that would make my code a lot messier/verbose. Is this change intentional?
Project Files
Javascript
Click To Expand
package.json:
# N/A
firebase.json for react-native-firebase v6:
# N/A
iOS
Click To Expand
ios/Podfile:
I'm not using Pods
I'm using Pods and my Podfile looks like:
# N/A
AppDelegate.m:
// N/A
Android
Click To Expand
Have you converted to AndroidX?
my application is an AndroidX application?
I am using android/gradle.settingsjetifier=true for Android compatibility?
I am using the NPM package jetifier for react-native compatibility?
Issue
After upgrading to 21.11.0, I got the TS error from my existing code:
This appears to be due to #7908 , meaning any provided
Item
fields are no longer allowed to be assignedundefined
. Specifically, the variable I am assigning toitem_variant
has the typestring | undefined
(in my code).Now, I could work around this by making a big conditional builder to only assign fields for which I have data, but that would make my code a lot messier/verbose. Is this change intentional?
Project Files
Javascript
Click To Expand
package.json
:# N/A
firebase.json
for react-native-firebase v6:# N/A
iOS
Click To Expand
ios/Podfile
:# N/A
AppDelegate.m
:// N/A
Android
Click To Expand
Have you converted to AndroidX?
android/gradle.settings
jetifier=true
for Android compatibility?jetifier
for react-native compatibility?android/build.gradle
:// N/A
android/app/build.gradle
:// N/A
android/settings.gradle
:// N/A
MainApplication.java
:// N/A
AndroidManifest.xml
:<!-- N/A -->
Environment
Click To Expand
react-native info
output:react-native-firebase
version you're using that has this issue:21.11.0
Firebase
module(s) you're using that has the issue:Analytics
TypeScript
?Y
&5.0.4
React Native Firebase
andInvertase
on Twitter for updates on the library.The text was updated successfully, but these errors were encountered: