elementalui / elemental

A flexible and beautiful UI framework for React.js
elemental-ui.com
MIT License
4.31k stars 216 forks source link

Runtime errors occur when importing Glyph or FormIconField components #220

Open acampbellb opened 6 years ago

acampbellb commented 6 years ago

This issue appears to be due to a change to export within Octicons.js. Previously, the export was as follows..

module.exports = { list: list, keys: pluck(list, 'value'), map: map };

It has since been changed to..

export const Octicon = { list: list, keys: pluck(list, 'value'), map: map };

Therefore, changes are required in the Glyph.js and FormIconField.js source files to accommodate the extra object level that was introduced (Octicon).

  1. Elemental\components\FormIconField.js

from: const ICON_MAP = require('../Octicons').map; const ICON_KEYS = require('../Octicons').keys; to: const ICON_MAP = require('../Octicons').Octicon.map; const ICON_KEYS = require('../Octicons').Octicon.keys;

  1. Elemental\components\Glyph.js

from: const icons = require('../Octicons').map; const validNames = require('../Octicons').keys; to: const icons = require('../Octicons').Octicon.map; const validNames = require('../Octicons').Octicon.keys;