Kamran Akbary
Kamran Akbary

Reputation: 2941

Output of console.log in React Native

Is it possible to debug styles at react-native in a screen for example?

console.log(styles.buttonBackground)// returns 140 console.log(styles.button.backgroundColor)// undefined

while it has background. I use all standard things of react-native. style is defined, debugger works well. but I'm unable to get the value of styles in debug.

Upvotes: 0

Views: 1878

Answers (2)

Tetsuya3850
Tetsuya3850

Reputation: 1019

Also, if you would like to debug Redux as well, try out React Native Debugger

I've written a guide on how to set it up with Expo.

Upvotes: 0

Pritish Vaidya
Pritish Vaidya

Reputation: 22189

You may try using react-devtools.

It synchronizes the inspector of the react-native with its debug tool to get the values of the react-dom elements.

The relevant details are mentioned here

Upvotes: 1

Related Questions