1.0.41 • Published 5 years ago

@daneroo/qcic-react v1.0.41

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

@daneroo/qcic-react

QCIC Reusable React Components and Hooks

NPM JavaScript Style Guide

  • These are packed with @pika/pack
  • .babelrc is still required along with: npm i -D @babel/preset-env @babel/preset-react

Install

npm install --save @daneroo/qcic-react

TODO

Usage

From mdx-deck, Counter and Fetch are broken. Because of hooks?

import React, { Component } from 'react'

import { Counter, Fetch, FetchDate, Simple, Stringify, Welcome  } from '@daneroo/qcic-react'

export default function Combined () {
  return (<div>
      <Welcome name="Dan-o-rama"/>
      <Simple text="Dan-eroo"/>
      <FetchDate text="Dan-eroo"/>
      <Counter initialCount={42} />
      <Stringify data={[1,{middle:'thing'},3]} />
      <Fetch url="https://time.qcic.n.imetrical.com" poll={true} delay={2000}>
        <Stringify />
      </Fetch>
  </div>)
}

Setup

This was inspired by the build from https://github.com/donavon/use-persisted-state

  • I replaced eslint with standard, and microbundle with @pika/pack

Mocking

Some of these tests are fetching external resources (e.g. https://time.qcic.n.imetrical.com), so we are now mocking the global fecth for jest tests. (This replaces a runtime dependency on axios)

npm install --save-dev jest-fetch-mock

And instrument a single test file with:

import { enableFetchMocks } from 'jest-fetch-mock'
enableFetchMocks()
1.0.41

5 years ago

1.0.38

5 years ago

1.0.29

5 years ago

1.0.28

5 years ago

1.0.30

5 years ago

1.0.27

5 years ago

1.0.23

5 years ago

1.0.21

5 years ago

1.0.19

5 years ago

1.0.20

5 years ago

1.0.18

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.1

6 years ago