Skip to content

Commit 661a384

Browse files
authored
Merge pull request #260 from huumanoid/fix-undefined-is-not-a-function
Fix NodeList to Array convertion
2 parents c4a4f87 + f731209 commit 661a384

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/index.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ import getPosition from './utils/getPosition'
1616
import getTipContent from './utils/getTipContent'
1717
import { parseAria } from './utils/aria'
1818

19+
import createArrayFromMixed from 'fbjs/lib/createArrayFromMixed'
20+
1921
/* CSS */
2022
import cssStyle from './style'
2123

@@ -154,10 +156,7 @@ class ReactTooltip extends Component {
154156
}
155157

156158
// targetArray is a NodeList, convert it to a real array
157-
// I hope I can use Object.values...
158-
return Object.getOwnPropertyNames(targetArray).map(key => {
159-
return targetArray[key]
160-
})
159+
return createArrayFromMixed(targetArray)
161160
}
162161

163162
/**

0 commit comments

Comments
 (0)