score:1

Accepted answer

You want the Object.keys() function or the Object.values

const SUB_THEME = {
  blue: 'Blue',
  yellow: 'Yellow',
  pink: 'Pink',
  purple: 'Purple',
  orange: 'Orange',
  green: 'Green'
}
//this returns the keys
const theme_keys = Object.keys(SUB_THEME)
//this returns the values
const theme_values = Object.values(SUB_THEME)

Then you can map them like

theme_keys.map( key => {/*code here*/})
theme_values.map( key => {/*code here*/})

score:0

You can use as below :

Object.keys(SUB_THEME).map( (key) => {
console.log(SUB_THEME[key]
})

score:0

 Object.keys(SUB_GROUPED).map(x => {
    console.log(x)
 })

score:0

Get object keys firstly with Object.keys(SUB_THEME).

score:2

Since you are trying to map an object you need to use Object.keys which returns an array of the objects keys that you can loop over.

Object.keys(SUB_THEME).map((key,index) => {
 const subTheme = SUB_THEME[key]
 return (
 <label className={styles.label}>
          <input
            type="radio"
            value={subTheme}
            name={subTheme}
            checked={subTheme === store.subTheme}
            onChange={(e) => store.changeSubTheme(e.target.value)}
          />
          {subTheme}
        </label>
  )
})

Related Query

More Query from same tag