Skip to content

Commit 72cca88

Browse files
committed
Fixed default props deprecation warning
0 parents  commit 72cca88

13 files changed

+11668
-0
lines changed

.DS_Store

6 KB
Binary file not shown.

.babelrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"presets": ["env", "react"],
3+
"plugins": [
4+
"transform-object-rest-spread"
5+
]
6+
}

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
dist
2+
node_modules
3+
4+
npm-debug.log
5+
webpack.config.js

.npmignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
src
3+
.babelrc
4+
.gitignore
5+
webpack.config.js

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 Tom Smith
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# React Pluralize
2+
A tiny pluralization component. Also check out [react-since](https://www.npmjs.com/package/react-since), another tiny component that presents time passed in a humanistic format.
3+
4+
## Install
5+
npm install react-pluralize --save
6+
7+
## Import
8+
import Pluralize from 'react-pluralize'
9+
10+
## Use
11+
<Pluralize singular={'view'} count={3} /> => 3 views
12+
<Pluralize singular={'person'} plural={'people'} count={3} /> => 3 people
13+
<Pluralize singular={'like'} showCount={false}/> => like
14+
<Pluralize singular={'click'} count={0} /> => 0 clicks
15+
<Pluralize singular={'hit'} count={0} zero={'Nothing to show'}/> => Nothing to show
16+
17+
## Props
18+
19+
**singular** (required)(String)
20+
The singular form of the noun
21+
22+
**plural** (optional)(default: singular + 's')(String)
23+
The plural form of the noun if required (i.e. when the plural form isn't just 's' added to the end)
24+
25+
**count** (optional)(default: 1)(Number)
26+
The count value used to determine whether the singular or plural form should be used.
27+
28+
**showCount** (optional)(default: true)(Boolean)
29+
If you would prefer not to see the count in the output then set this prop to false.
30+
31+
**zero** (optional)(default: null)(String)
32+
If you would like to show a different message when the count is 0 you can provide this prop.
33+
34+
**className** (optional)(default: null)(String)
35+
36+
**style** (optional)(default: {})(Object)

0 commit comments

Comments
 (0)