Avoid Array.prototype.fill()
parent
1b9b8983bb
commit
435250f319
|
@ -29,7 +29,8 @@ export default class Skins extends React.Component {
|
||||||
|
|
||||||
return <div>
|
return <div>
|
||||||
<div className={`emoji-mart-skin-swatches ${opened ? 'emoji-mart-skin-swatches-opened' : ''}`}>
|
<div className={`emoji-mart-skin-swatches ${opened ? 'emoji-mart-skin-swatches-opened' : ''}`}>
|
||||||
{Array(6).fill().map((_, i) => {
|
{/* Use Array.prototype.fill() when it is more widely supported. */}
|
||||||
|
{[...Array(6)].map((_, i) => {
|
||||||
var skinTone = i + 1,
|
var skinTone = i + 1,
|
||||||
selected = skinTone == skin
|
selected = skinTone == skin
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,8 @@ function get(perLine) {
|
||||||
if (!frequently) {
|
if (!frequently) {
|
||||||
defaults = {}
|
defaults = {}
|
||||||
|
|
||||||
return Array(perLine).fill('').map((_, i) => {
|
// Use Array.prototype.fill() when it is more widely supported.
|
||||||
|
return [...Array(perLine)].map((_, i) => {
|
||||||
defaults[DEFAULTS[i]] = perLine - i
|
defaults[DEFAULTS[i]] = perLine - i
|
||||||
return DEFAULTS[i]
|
return DEFAULTS[i]
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue