1.0.8 • Published 4 years ago

@asteffey/react-fcc-test v1.0.8

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

Overview

A React hook to add the freeCodeCamp test suite bundle.

Installation

npm install @asteffey/react-fcc-test or yarn add @asteffey/react-fcc-test

Usage

  • import { useFccTest, FccTests } from '@asteffey/react-fcc-test'
  • useFccTest() will display the FCC test suite.
  • useFccTest({fccTest: 'random-quote-machine'}) will select the specified test from the test suite's dropdown list. FccTests contains an enumeration of all acceptable tests (e.g., FccTests.random_quote_machine, FccTests.bar_chart).
  • useFccTest({queryParam: 'some-parameter'}) will only display the FCC test suite if the specified parameter is present in the URL query string.

Example

import React from 'react';
import { useFccTest, FccTests } from '@asteffey/react-fcc-test';

const App = () => {
    useFccTest({
        fccTest: FccTests.random_quote_machine,
        queryParam: 'fcc-test'
    });

    return (
        <main>
            ...
        </main>
    );
};

export default App;
1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago