Skip to content

Instantly share code, notes, and snippets.

@YannisMarios
YannisMarios / DynamicComponents.js
Last active June 16, 2022 03:58
Dynamic loading of React components using a JSON config
import React, { lazy, Suspense } from 'react'
import Spinner from '../../ui/spinner/Spinner' // Some Spinner
const config = [
{
name: 'First',
path: './First',
props: {name: 'Yannis', surname: 'Marios'}
},
{