This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@kth/kth-node-react-common

1.0.32 • Public • Published

kth-node-react-common alt text

KTH Stockholm has several applications which are based on React and support server-side rendering with Node.js, e.g. some smaller parts of https://www.kth.se. This package contains common utility functions and components used by those applications.

Installation

  • Install the package:

    npm install @kth/kth-node-react-common
  • Install the peer-dependencies of the package:

    npm install axios react prop-types

How to use

  • Option 1: Import parts of the package and destructure them then:

    // Examples (ES6 style):
    import { Utils, Components, FormComponents, MobxUtils } from '@kth/kth-node-react-common'
    
    const { ensureObject } = Utils
    const { Breadcrumbs, SystemMessage } = Components
    const { useDataBag, Input } = FormComponents
    const { useStore } = MobxUtils
    // Examples (CommonJS style):
    const { Utils, Components, FormComponents, MobxUtils } = require('@kth/kth-node-react-common')
    
    const { ensureObject } = Utils
    const { Breadcrumbs, SystemMessage } = Components
    const { useDataBag, Input } = FormComponents
    const { useStore } = MobxUtils
  • Option 2: Import sub-directory of the package and destructure them directly:

    // Examples (ES6 style):
    import { ensureObject } from '@kth/kth-node-react-common/utils'
    import { Breadcrumbs, SystemMessage } from '@kth/kth-node-react-common/components'
    import { useDataBag, Input } from '@kth/kth-node-react-common/FormComponents'
    import { useStore } from '@kth/kth-node-react-common/MobxUtils'
    // Examples (CommonJS style):
    const { ensureObject } = require('@kth/kth-node-react-common/utils')
    const { Breadcrumbs, SystemMessage } = require('@kth/kth-node-react-common/components')
    const { useDataBag, Input } = require('@kth/kth-node-react-common/FormComponents')
    const { useStore } = require('@kth/kth-node-react-common/MobxUtils')
  • Option 3: Import parts of the package, destructure them twice directly:

    This is only possible with CommonJS style imports.

    // Examples (CommonJS style):
    const { ensureObject } = require('@kth/kth-node-react-common').Utils
    const { Breadcrumbs, SystemMessage } = require('@kth/kth-node-react-common').Components
    const { useDataBag, Input } = require('@kth/kth-node-react-common').FormComponents
    const { useStore } = require('@kth/kth-node-react-common').MobxUtils

Package content

The different parts of this package are described in detail in the following Markdown files:

  • MobxUtils
  • Other utilities (tbd.)
  • Helper components (tbd.)
  • FormHelper components (tbd.)

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Published

Version History

  • Version
    Downloads (Last 7 Days)
    • Published

Package Sidebar

Install

npm i @kth/kth-node-react-common

Weekly Downloads

1

Version

1.0.32

License

MIT

Unpacked Size

226 kB

Total Files

57

Last publish

Collaborators

  • kth-stratus
  • mictsi
  • n_sandstrom
  • kthwebmaster
  • exacs
  • ssundkvist
  • kth-ci
  • emilstenberg