@ouroboros/react-errors 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -41,8 +41,5 @@ declare namespace Errors {
41
41
  var propTypes: {
42
42
  position: PropTypes.Requireable<string>;
43
43
  };
44
- var defaultProps: {
45
- position: string;
46
- };
47
44
  }
48
45
  export default Errors;
package/index.js CHANGED
@@ -38,7 +38,7 @@ export function addError(error) {
38
38
  * @param Object props Properties passed to the component
39
39
  * @returns React.Component
40
40
  */
41
- export default function Errors({ position }) {
41
+ export default function Errors({ position = 'bottom' }) {
42
42
  // State
43
43
  const [errors, errorsSet] = useState([]);
44
44
  // Load effect
@@ -98,7 +98,3 @@ export default function Errors({ position }) {
98
98
  Errors.propTypes = {
99
99
  position: PropTypes.oneOf(['bottom', 'top'])
100
100
  };
101
- // Default props
102
- Errors.defaultProps = {
103
- position: 'bottom'
104
- };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouroboros/react-errors",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Errors Component. Shows error messages sent to it.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -32,8 +32,8 @@
32
32
  "typescript": "^4.8.3"
33
33
  },
34
34
  "dependencies": {
35
- "@ouroboros/events": "^1.0.1",
36
- "@ouroboros/tools": "^0.5.4",
35
+ "@ouroboros/events": "^1.1.0",
36
+ "@ouroboros/tools": "^0.6.1",
37
37
  "prop-types": "^15.8.1",
38
38
  "uuid": "^10.0.0"
39
39
  },
@@ -54,9 +54,7 @@ export function addError(error: string | object): void {
54
54
  * @param Object props Properties passed to the component
55
55
  * @returns React.Component
56
56
  */
57
- export default function Errors({
58
- position
59
- }: ErrorsProps) {
57
+ export default function Errors({ position = 'bottom' }: ErrorsProps) {
60
58
 
61
59
  // State
62
60
  const [ errors, errorsSet ] = useState<ErrorMessageType[]>([]);
@@ -141,9 +139,4 @@ export default function Errors({
141
139
  // Valid props
142
140
  Errors.propTypes = {
143
141
  position: PropTypes.oneOf([ 'bottom', 'top' ])
144
- }
145
-
146
- // Default props
147
- Errors.defaultProps = {
148
- position: 'bottom'
149
142
  }
package/tsconfig.json CHANGED
@@ -10,11 +10,12 @@
10
10
  "types": ["react", "node"],
11
11
  "moduleResolution": "node",
12
12
  "noEmit": false,
13
+ "outDir": ".",
13
14
  "resolveJsonModule": true,
14
15
  "strict": true,
15
16
  "strictPropertyInitialization": false,
16
17
  "target": "esnext"
17
18
  },
18
- "include": ["./"],
19
+ "include": ["./src"],
19
20
  "exclude": []
20
21
  }