0.1.1 • Published 4 years ago

@tigre/isomorphic-style-loader-decorator v0.1.1

Weekly downloads
1
License
SEE LICENSE IN LI...
Repository
-
Last release
4 years ago

@tigre/isomorphic-style-loader-decorator

A simple library that provides a React class decorator for use with isomorphic-style-loader. When using the style-loader you need to mark the styles as actually used so that they can be added to the document on both the client and server during SSR. Adding this decorator makes marking the styles used much easier when using class based React components.

Includes TypeScript .d.ts for use.

Installation

yarn add @tigre/isomorphic-style-loader-decorator

Usage

import React from "react";
import { withStyle } from "@tigre/isomorphic-style-loader-decorator";
import style from "./component.css";

@withStyle(style)
export class ThisComponent extends React.Component {
    render() {
        // Magic rendering...
        return null;
    }
}

License

Contact for licensing options.