@react-native-community/blur not working on expo?

Viewed 3306

Im using Expo and im using <BlurView /> of @react-native-community/blur .. and it throws me an error of Invariant Violation: requireNativeComponent: "BlurView" was not found in the UIManager.. Does Expo not supporting @react-native-community/blur?

expo version: 40.0.0 Emulator: Android

other note:

i did try expo-blur but it does not blur as what i expected to be.. so that's why im using @react-native-community/blur.

    <ImageBackground source={background} style={styles.imageContainer}>
      <SafeAreaView style={styles.container}>
        <StatusBar backgroundColor={THEME.WHITE} barStyle='dark-content' />
        <BlurView style={styles.formContainer}>
          <View style={{ marginBottom: 15 }}>
            <Input
              leftIcon={
                <Icon
                  color={THEME.GREY_6}
                  name='email'
                  type={ICON.MaterialCommunityIcons}
                  variant={VARIANT.MEDIUM}
                />
              }
              placeholder='Email'
              onChangeText={(e) => onChangeEmail(e)}
            />
          </View>
          <View>
            <Input
              leftIcon={
                <Icon
                  color={THEME.GREY_6}
                  name='onepassword'
                  type={ICON.MaterialCommunityIcons}
                  variant={VARIANT.MEDIUM}
                />
              }
              placeholder='Password'
              onChangeText={(e) => onChangeEmail(e)}
            />
          </View>
          <View style={styles.forgotPassContainer}>
            <Text style={styles.text}>Forgot Password?</Text>
          </View>
          <View style={styles.loginButton}>
            <Button label='Login' onPress={handleLogin} />
          </View>
          <View
            style={{
              padding: 15,
              alignItems: 'center',
              borderTopWidth: 0.2,
              marginTop: 15,
            }}
          >
            <Text style={styles.text}>Sign Up</Text>
          </View>
        </BlurView>
      </SafeAreaView>
    </ImageBackground>

what im trying to achieve is making the formContainer blur its background.

2 Answers

Try this code. Im using the BlurView of expo-blur

<View style={{flex: 1}}>
   <BlurView tint="dark" intensity={100} style={{ position: 'absolute', height:'100%', width:'100%,}} />
   <View style={{flex: 1}}>
      //content here
   </View>
</View>
Related