ehscan-react-components 0.1.41 → 0.1.42

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.
Files changed (2) hide show
  1. package/README.md +27 -30
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -19,39 +19,36 @@ The component is fully controlled — the parent manages the state and receives
19
19
 
20
20
  ### Implementation
21
21
 
22
- ```tsx
23
- import { useEffect, useState } from "react";
24
- import { AddBox, useChangeAddBox } from "ehscan-react-components";
22
+ ```jsx
23
+ import { useEffect, useState } from "react";
24
+ import { AddBox, useChangeAddBox } from 'ehscan-react-components';
25
25
 
26
- const Elements = () => {
26
+ const Elements = () => {
27
27
 
28
28
  const [inValue, setInValue] = useState({
29
- add: [
30
- { id: 0, title: "first Entry" },
31
- { id: 1, title: "second Entry" },
32
- { id: 2, title: "last Entry" }
33
- ]
34
- });
35
-
36
- // Log changes whenever entries are updated
37
- useEffect(() => {
38
- console.log(inValue);
39
- }, [inValue]);
40
-
41
- // Scoped change function for the "add" key
42
- const changeAddBox = useChangeAddBox(inValue, setInValue, "add");
43
-
44
- return (
45
- <div className="element-wrapper">
46
- <AddBox
47
- value={inValue.add}
48
- onChange={(value, id) => changeAddBox(value, id)}
49
- />
50
- </div>
51
- );
52
- }
53
-
54
- export default Elements;
29
+ add: [
30
+ { id: 0, title: "first Entry" },
31
+ { id: 1, title: "second Entry" },
32
+ { id: 2, title: "last Entry" }
33
+ ]
34
+ });
35
+
36
+ useEffect(() => {
37
+ console.log(inValue); //use ValueChanges on save
38
+ },[inValue])
39
+
40
+ const changeAddBox = useChangeAddBox(inValue, setInValue, "add"); //change on specific tag
41
+
42
+ return (
43
+ <>
44
+ <div className="element-wrapper"> {/* ✏️ Put custom styling overrides here */}
45
+ <AddBox title="Element-Title" value={inValue.add} onChange={(value, id) => changeAddBox(value, id)} />
46
+ </div>
47
+ </>
48
+ );
49
+ }
50
+
51
+ export default Elements;
55
52
  ```
56
53
 
57
54
  ### Styling
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ehscan-react-components",
3
- "version": "0.1.41",
3
+ "version": "0.1.42",
4
4
  "description": "components",
5
5
  "main": "dist/Components.js",
6
6
  "types": "dist/Components.d.ts",