diff --git a/components/MultipleSelectList.tsx b/components/MultipleSelectList.tsx index 1e8e3326..e8d2f551 100644 --- a/components/MultipleSelectList.tsx +++ b/components/MultipleSelectList.tsx @@ -42,13 +42,14 @@ const MultipleSelectList: React.FC = ({ badgeTextStyles, checkBoxStyles, save = 'key', - dropdownShown = false + dropdownShown = false, + seedSelectedVals = [] }) => { const oldOption = React.useRef(null) const [_firstRender,_setFirstRender] = React.useState(true); const [dropdown, setDropdown] = React.useState(dropdownShown); - const [selectedval, setSelectedVal] = React.useState([]); + const [selectedval, setSelectedVal] = React.useState(seedSelectedVals); const [height,setHeight] = React.useState(350) const animatedvalue = React.useRef(new Animated.Value(0)).current; const [filtereddata,setFilteredData] = React.useState(data); diff --git a/index.d.ts b/index.d.ts index cee3ba03..a3fad9a1 100644 --- a/index.d.ts +++ b/index.d.ts @@ -116,6 +116,11 @@ export interface SelectListProps { export interface MultipleSelectListProps { + /** + * the initial selected values of the multiple select list + */ + seedSelectedVals?: Array<{}>, + /** * Fn to set Selected option value which will be stored in your local state */