Answer the question
In order to leave comments, you need to log in
Do such imports inflate the bundle?
webpack4.
import Archive from '@icons/basic-24-archive_24';
import Message from '@icons/basic-24-message_24';
import Pin from '@icons/basic-24-pin_24';
import React from 'react';
const icons = {
Archive,
Message,
Pin
};
export default (iconName) => {
return React.createElement(icons[iconName] || Pin);
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question