Skip to content

Instantly share code, notes, and snippets.

View moalhaddar's full-sized avatar

Mohammed Alhaddar moalhaddar

View GitHub Profile
@moalhaddar
moalhaddar / module-federation-imports.md
Last active June 4, 2023 07:34
Module Federation Imports Missing Document

Motivation

When transitioning the monolith web app into micro-frontends using module federation, i was confused about the entire concept behind lazy loading and importing components.

You have different variations of how you could load the remote's exposed modules.

  1. Using ESM dynamic imports
    useEffect(() => {
@moalhaddar
moalhaddar / gist:6c20da34a2b5388b86424c8c9390cf45
Last active July 5, 2020 09:30
React hook for managing a form field
import React, { useState } from "react"
import { Form, FormControl } from "react-bootstrap"
export const useFormField = (type) => {
const [form, setForm] = useState({ data: "", isInvalid: false, message: "" })
const setData = (newData) => {
setForm({