Codstak
    • Home
    • DSA
    • JavaScript
    • TypeScript
    • Node.js
    • React
    • More↓
      BlogReact PrepPricingDiscordNewsletterLeaderboard
    React challenge/medium

    Repair the App Shell Theme Preference

    Challenge workspace

    35-45 min
    Component compositionPath 25/33
    Components & propsCompositionState & eventsPersistence

    Suggested first

    Repair Account Settings Tabs

    Your workspace must pass its server-side browser checks to complete this challenge.

    Theme Preference

    Share a persistent preference through React context.

    Requirements

    • Create a strictly typed context.
    • Throw a helpful error when the context is missing.
    • Toggle between light and dark without duplicating state.
    • Persist and restore the preference with localStorage.
    • Keep storage access inside state and event logic.