React-native-blur: Fading in?

Created on 14 Oct 2015  Â·  6Comments  Â·  Source: Kureev/react-native-blur

Hey,

Awesome work on this.

Tried using Animated with the BlurView but it returns Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined.

Wrapping in view that animates opacity doesn't work either.

Any suggestions?

feedback needed

Most helpful comment

I got the same error message when I didn't access the .BlurView property too.

var BlurView = require('react-native-blur').BlurView;

All 6 comments

Can you provide an example code?

Just a guess, but the error message sounds quite similar as the one you get when you forget to access the .BlurView property of require('react-native-blur') and your local variable ends up pointing to the wrapper object instead.

I got the same error message when I didn't access the .BlurView property too.

var BlurView = require('react-native-blur').BlurView;

@nc @chanange react-native-blur contain native Obj-C implementation. Are you sure you linked them correct? (see https://github.com/Kureev/react-native-blur#installation)

Yep I linked the RNBlur project and added the libRNBlur.a product to the Build Phases - Link Binary with Libraries.

I got the error message when I imported the module with the following import, as described in the README:

var BlurView = require('react-native-blur')

But accessing with the .BlurView property works.

var BlurView = require('react-native-blur').BlurView

@chanange In the docs I use

const { BlurView, VibrancyView } = require('react-native-blur');

which is equals to

const BlurView = require('react-native-blur').BlurView;
const VibrancyView = require('react-native-blur').VibrancyView;

so it seems everything is fine.

Was this page helpful?
0 / 5 - 0 ratings