Closed SamuelScheit closed 2 years ago
I'm but this feature can't be added soon, as it requires a third-party dependency which we're not looking forward to adding. But you can create a custom component that uses BlurView and relies on _blur prop to render it or not. The code will look something like
const MyBlurComponent = ({children, _blur}) => {
return _blur ? <BlurView {..._blur}>{children}</BlurView> : children
}
And if you want you can use the factory functioned version of BlurView instead.
Problem I'm currently developing a project where users can submit their own themes, however currently it is not possible to create a glassmorphism theme, because there is no pseudo
_blur
property.Solution Just like the
_hover
and_text
pseudo property, there should be an option to specify a background blur effect:https://github.com/Kureev/react-native-blur
Alternatives I could instead manually wrap every component inside a native base factory, but this is not very feasible.
Implementation I'm willing to create a PR if this feature request will be approved. Let me know if I have to watch out for certain things other than the COC and contribution guide.
If the
_blur
property is specified it should get passed to theBlurView
of @react-native-community/blur, which will wrap the element.