import from `expo-linear-gradient` giving error

I am upgrading my app to expo-33 and as adviced changing the imports to modular imports. But for the package linear gradient, getting an error. I am doing
import * as LinearGradient from 'expo-linear-gradient';
but this is giving error for Invariant Violation. If I skip this step and import it as before,
import { LinearGradient } from 'expo';,
its working fine. Can anybody help me with the issue here?

Hey @aditi-thistle, the correct import syntax is import {LinearGradient} from 'expo-linear-gradient'.

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.