// values.js
export initValues = ['one', 'two', 'three']
// index.js
import React from 'react'
import ReactDOM from 'react-dom'
import {initValues} from './values'
class MyComponent extends React.Component {
get values() {
return [...initValues, 'four']
}
render() {
const {text, obj: {name}} = this.props
return (
<div>
<ul>
{this.values.map(value => <li>{text} : {name} : {value}</li>)}
</ul>
</div>
)
}
}
ReactDOM.render(
<MyComponent obj={{name: 'Vilnius'}} text="Hello" />,
document.getElementById('app')
)