I'm making something in React Native and there's a module where I have a variable called jorge
const jorge = "This is some output";
console.log(jorge); //output: 'This is some output'
I've passed props item to this module (I'm using the react-native-router-flux module, which also has a value of jorge:
<Scene
key="sceneTwo"
component={componentItem}
title={content.title}
item="jorge"
/>
I'd like to be able to do this:
console.log(this.props.item); //output: 'This is some output'
Whereas in reality, I get this:
console.log(this.props.item); //output: 'jorge'
I'm not sure what this technique is called hence the extremely vague title, but if anyone can suggest how I'd tackle this I'd be very grateful!
'jorge'orjorgeas the prop?jorgethe property of an object (i.e., you can access it usingobj.jorge)? Perhapswindow.jorge? Then you can access it via "bracket syntax" likeorg[this.props.item].