sau123 sau123 - 1 year ago 75
Javascript Question

using this.props.someVariable

I am using this.props.someVariable to pass on a variable from one component to another. I would like to debug the variable using console.log().

I am not able to use it in console.log(this.props.someVariable) but it works fine within a tag.

var secondComp = React.createClass({
console.log({this.props.myProp}); // doesn't work

Answer Source

Just do: