Can't find a way to use setStatusBarStyle

  1. SDK Version: 44
  2. Platforms(Android/iOS/web/all): Android/iOS
  3. Add the appropriate “Tag” based on what Expo library you have a question on.

Hi! in this snack I have created a little example to try to programmatically change status bar style

I can’t use setStatusBarStyle

If used like this

StatusBar.setStatusBarStyle(‘light’)

I get TypeError: _expoStatusBar.StatusBar.setStatusBarStyle is not a function.

If used like this



<StatusBar
ref = {(ref) => (this.statusbar = ref)}
style=‘light’
/>

this.statusbar.setStatusBarStyle(‘light’)

I get null is not an object (evaluating _this.StatusBar.setStatusBarStyle )

Forget it… just found a way

import { StatusBar, setStatusBarStyle } from 'expo-status-bar';
...
...
setStatusBarStyle('light');
...
...

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