-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
Is it possible to load node modules asynchronously using async-reactor
. The following snippet does not work but I hope explains the use case:
import React from 'react'
import { asyncReactor } from 'async-reactor'
const Component = async arr => (
<div>
{arr.map(obj => {
const Icon = await import(obj.nodeModule)
return (
<div key={obj.title}>
<Icon /> {obj.title}
</div>
)
})}
</div>
)
export default asyncReactor(Component)
obj.nodeModule
is a dynamic string and the import path of a node module, in my case styled-icons
, e.g. obj.nodeModule = styled-icons/boxicons-logos/Github
.
Metadata
Metadata
Assignees
Labels
No labels