@nappr/nappr-todolist
Nappr TodoList component
Last updated 2 months ago by sixertoy .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @nappr/nappr-todolist 
SYNC missed versions from official npm registry.

???? NAPPR TodoList

NPM version Build

Full Documentation

Install

yarn add @nappr/nappr-todolist

Required Dependencies

Usage

import React, { useState } from 'react';
import PropTypes from 'prop-types';
import { v1 as uuidv1 } from 'uuid';
import NapprTodoList from '@nappr/nappr-todolist';

const ikea = require('ikea-name-generator');

function App({ items }) {
  const [tasks, updateTasks] = useState(items);
  return (
    <div className="app">
      <div style={{ height: 200 }}>
        <NapprTodoList
          onChange={(clickedTaskId, clickedtaskCheckValue) => {
            const next = tasks.map(obj => {
              if (obj.id !== clickedTaskId) return obj;
              return { ...obj, checked: clickedtaskCheckValue };
            });
            updateTasks(next);
          }}
          tasks={tasks}
        />
      </div>
    </div>
  );
}

App.defaultProps = {
  items: [...Array(10).keys()].map(() => ({
    checked: false,
    id: uuidv1(),
    label: ikea.getName(),
  })),
};

App.propTypes = {
  items: PropTypes.arrayOf(PropTypes.shape()),
};

export default App;

Current Tags

  • 0.1.33                                ...           latest (2 months ago)

17 Versions

  • 0.1.33                                ...           2 months ago
  • 0.1.32 [deprecated]           ...           2 months ago
  • 0.1.31 [deprecated]           ...           2 months ago
  • 0.1.29 [deprecated]           ...           2 months ago
  • 0.1.28 [deprecated]           ...           2 months ago
  • 0.1.27 [deprecated]           ...           2 months ago
  • 0.1.26 [deprecated]           ...           2 months ago
  • 0.1.25 [deprecated]           ...           2 months ago
  • 0.1.24 [deprecated]           ...           2 months ago
  • 0.1.23 [deprecated]           ...           2 months ago
  • 0.1.22 [deprecated]           ...           2 months ago
  • 0.1.21 [deprecated]           ...           2 months ago
  • 0.1.20 [deprecated]           ...           2 months ago
  • 0.1.19 [deprecated]           ...           2 months ago
  • 0.1.18 [deprecated]           ...           2 months ago
  • 0.1.17 [deprecated]           ...           2 months ago
  • 0.1.15 [deprecated]           ...           2 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |