wix / react-native-ui-lib

UI Components Library for React Native
https://wix.github.io/react-native-ui-lib/
MIT License
6.54k stars 712 forks source link

Warnings in RN 67 : `new NativeEventEmitter()` was called with a non-null argument without the required `removeListeners` method.) #1820

Closed jrobber closed 2 years ago

jrobber commented 2 years ago

Description

Using this library in RN 67 throws this warning: new NativeEventEmitter() was called with a non-null argument without the required removeListeners method.)

It can cause unreliable side effects and issues on android where errors are some times thrown and click events become non-responsive.

The fix is simple: https://github.com/software-mansion/react-native-reanimated/issues/2297#issuecomment-904056543

Related to

Steps to reproduce

Upgrade any decent project to RN 67 and use the latest of this library.

Expected behavior

No warnings and side effects

Actual behavior

Warning in console and side effects

Code snippet

<Picker
          placeholder="Search"
          value={searchText}
          enableModalBlur={false}
          onChange={(item) => handleInputChange(item)}
          topBarProps={{ title: "Search" }}
          showSearch
          searchPlaceholder={"Search for a city"}
          renderPicker={(selectedItem, itemLabel) => {
            return (
              <Section
                left
                row
                stretch
                flex={1}
                backgroundColor="inputBackground"
                padding="s"
                borderRadius="m">
                <Icon
                  name={"search"}
                  size={20}
                  color={colors.inactiveIcon}
                  style={{ paddingRight: 5 }}
                />
                <Text
                  style={{
                    fontSize: 16,
                    lineHeight: 20,
                  }}
                  // textContentType="location"
                  // placeholder="Search for a place or address"
                  // onChange={handleInputChange}
                  // onSubmitEditing={handleSubmit}
                  // onFocus={handleInputFocus}
                  // autoFocus={false}
                  // returnKeyType={"search"}
                  // selectTextOnFocus
                  // placeholderTextColor={colors.secondary}
                  // clearButtonMode={"while-editing"}
                  // inlineImageLeft={
                  //   Platform.OS === "android" ? "search_icon" : undefined
                  // }
                  // onBlur={handleInputBlur}
                >
                  {searchText}
                </Text>
              </Section>
            )
          }}
          // onSearchChange={value => console.warn('value', value)}
        >
          {["Here", "There", "CodeVille", "DevTown"].map((option) => (
            <Picker.Item
              key={option}
              value={option}
              label={option}
              disabled={false}
            />
          ))}
        </Picker>

Environment

Affected platforms

jrobber commented 2 years ago

I thought I had updated all my other third parties, but I found one more, updated it, an this went away.

joaodematejr commented 2 years ago

+1 Ios too