I'm following the ReactJS tutorial (http://redux.js.org/docs/basics/UsageWithReact.html) for the basic todo list and tweaking it to my liking, but am running into the following error:
Uncaught TypeError: Cannot read property 'map' of undefined
Here is the code:
ConfigList.js -
import React, {Component, PropTypes} from 'react';
import ConfigItem from '../components/ConfigItem';
const ConfigList = ({ configs }) => (
<ul>
{configs.map(config =>
<ConfigItem
key={config.id}
/>
)}
</ul>
);
ConfigList.propTypes = {
configs: PropTypes.arrayOf(PropTypes.shape({
id: PropTypes.number.isRequired,
text: PropTypes.string.isRequired
}))
};
export default ConfigList;
ConfigItem.js -
import React, { PropTypes } from 'react';
const ConfigItem = ({ text }) => (
<li>{text}</li>
);
ConfigItem.propTypes = {
text: PropTypes.string.isRequired
};
export default ConfigItem;
I'm new to ReactJS and somewhat new to Javascript so I'm hoping I get some feedback as to why I'm seeing this error, and what steps I can take to get past it.