New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

react-context-themify

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-context-themify

The purpose of this package is to provide a simple way to change the theme of your application using React Context.

latest
npmnpm
Version
0.1.4
Version published
Maintainers
1
Created
Source

React Context Themify

The purpose of this package is to provide a simple way to change the theme of your application using React Context.

🚀 Technologies

  • React
  • TypeScript
  • TSDX

🖥️ How to use

ThemeProvider is a React Component to involve your application and provide the theme context

import { ThemeProvider } from 'react-context-themify';

const App = () => {
  return (
    <ThemeProvider>
      <html lang="en">
        <body>
          <ThemeProvider>{children}</ThemeProvider>
        </body>
      </html>
    </ThemeProvider>
  );
};

UseThemeContext is a React Hook to get the current theme and change it

import { useThemeContext } from 'react-context-themify';

const Component = () => {
  const { themeName, toggleTheme } = useThemeContext();

  return (
    <div>
      <p>Current theme: {themeName}</p>
      <button onClick={toggleTheme}>Toggle theme</button>
    </div>
  );
};

🗒️Note

This package is not working with Next.js yet.

Developed By:

FAQs

Package last updated on 06 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts