Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sixertoy/nappr-todolist

🍰Nappr TodoList - A React TodoList Component
https://github.com/sixertoy/nappr-todolist

component react reactjs todo todolist

Last synced: 11 days ago
JSON representation

🍰Nappr TodoList - A React TodoList Component

Awesome Lists containing this project

README

        

# 🍰 NAPPR TodoList

[![NPM version][npm-version-img]][npm-url] [![Build][travis-img]][travis-url]

[**Full Documentation**](https://sixertoy.github.io/nappr-todolist/#/)

## Install

```bash
yarn add @nappr/nappr-todolist
```

#### Required Dependencies

- [react-jss^10.0.4](https://www.npmjs.com/package/react-jss)

## Usage

```javascript
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 (



{
const next = tasks.map(obj => {
if (obj.id !== clickedTaskId) return obj;
return { ...obj, checked: clickedtaskCheckValue };
});
updateTasks(next);
}}
tasks={tasks}
/>


);
}

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

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

export default App;
```

[travis-url]: https://travis-ci.org/sixertoy/nappr-todolist
[travis-img]: http://img.shields.io/travis/sixertoy/nappr-todolist.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/@nappr/nappr-todolist
[npm-version-img]: http://img.shields.io/npm/v/@nappr/nappr-todolist.svg?style=flat-square