I have a data object that looks like the shot below:
The data is coming from my Redux store, so when I want to display let's say the IP of camera_1, I can reach it the following way: this.props.data.settings.cameras.camera_1.IP._text
My problem is that if I want to build programmatically the path above I get an error because REACT take the path as a string. Yes I know, I'm building the path with literal strings but how to solve the problem? :-/
This is the way I'm trying to build the path:
const root = this.props.data.settings
// The following strings are coming from the previous page as routing params
const {page,node,item} = this.props.match.params
// The strings have the following values
page = 'cameras'
node = 'camera_1'
item = 'IP'
const fullPath = `${root}.${page}.${node}.${item}._text`
I appreciate your time and help!
Thanks :-)))