From ce85534e86cb59534a2b5cc3a605078bdd91ef8f Mon Sep 17 00:00:00 2001 From: Joey Payne Date: Fri, 11 Mar 2016 15:12:53 -0700 Subject: [PATCH] Make default list item propable --- app/components/SelectableList.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/components/SelectableList.jsx b/app/components/SelectableList.jsx index dc62dd9..1a3913b 100644 --- a/app/components/SelectableList.jsx +++ b/app/components/SelectableList.jsx @@ -9,7 +9,9 @@ let SelectableList = SelectableContainerEnhance(List) function wrapState(ComposedComponent) { const StateWrapper = React.createClass({ getInitialState() { - return {selectedIndex: -1}; + if(typeof this.props.initialIndex == 'undefined') + return {selectedIndex: -1}; + return {selectedIndex: this.props.initialIndex}; }, setIndex(i, func){ this.setState({