This commit is contained in:
16
webseite-react-php/react-app/package-lock.json
generated
16
webseite-react-php/react-app/package-lock.json
generated
@@ -14,7 +14,7 @@
|
||||
"react": "^19.2.8",
|
||||
"react-dom": "^19.2.8",
|
||||
"react-icons": "^5.7.0",
|
||||
"react-router-dom": "^7.18.2"
|
||||
"react-router-dom": "^7.18.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^19.2.18",
|
||||
@@ -1963,9 +1963,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/react-router": {
|
||||
"version": "7.18.2",
|
||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-7.18.2.tgz",
|
||||
"integrity": "sha512-aUVMjFm3GAPTTZL7oYr5E7ETiqfQCHRLH+B+5afnICvf0r7kkK4eR6SMuwbSTJw/7t+12khT/Kahij49fqOCIg==",
|
||||
"version": "7.18.3",
|
||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-7.18.3.tgz",
|
||||
"integrity": "sha512-gyXgtdr5uACJ5b1Q4udzjVV+tb/rlHIMJKuJ0e89R4Kzgz47z/rgP0dIKxktqIEUhDHluGTPJJH/wRha7CyqsA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"cookie": "^1.0.1",
|
||||
@@ -1985,12 +1985,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/react-router-dom": {
|
||||
"version": "7.18.2",
|
||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.18.2.tgz",
|
||||
"integrity": "sha512-AIKJ/jgGlFb3EbfCXk5Gzshiwt+l3mqbCrNjmEWMMjqQxNJ3svBa6bgzFyCC2Sw3RA0VWF1kg3uQf2OFhxb8hw==",
|
||||
"version": "7.18.3",
|
||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.18.3.tgz",
|
||||
"integrity": "sha512-ytVbyBBM7vMfRCam25r0WMhSVSom909A8p+8m0/f1w853dz/xfFu6etAT2SEbVoSnI+ZoPRDqIsQXVT89gp7kg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"react-router": "7.18.2"
|
||||
"react-router": "7.18.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.0.0"
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
"react": "^19.2.8",
|
||||
"react-dom": "^19.2.8",
|
||||
"react-icons": "^5.7.0",
|
||||
"react-router-dom": "^7.18.2"
|
||||
"react-router-dom": "^7.18.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^19.2.18",
|
||||
|
||||
@@ -3,8 +3,9 @@ import RowProduct from './content/RowProduct';
|
||||
import { ProductsProvider, useProductsState } from '../../stores/products';
|
||||
|
||||
const TableProductsView = (props) => {
|
||||
const { items } = useProductsState();
|
||||
// const dispatch = useProductsDispatch()
|
||||
const { items } = useProductsState(); // const {items} = useContext(ProductsStateContext);
|
||||
|
||||
// const dispatch = useProductsDispatch() // const dispatch = useContext(ProductsDispatchContext);
|
||||
|
||||
//const [{ items }, dispatch] = useReducer(reducer, initialState(props));
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { memo, useCallback } from 'react';
|
||||
import { useProductsActions } from '../../../stores/products'; // /index.js muss nicht angegeben werden (wg. Bundler)
|
||||
|
||||
// import { useProductsDispatch } from '../../../stores/products';
|
||||
// import { PRODUCTS_ACTIONS } from '../../../stores/products';
|
||||
//import { PRODUCTS_ACTIONS } from '../../../stores/products';
|
||||
|
||||
import InputAmount from '../../inputs/InputAmount';
|
||||
import InputPrice from '../../inputs/InputPrice';
|
||||
@@ -11,7 +12,7 @@ const RowProduct = (props) => {
|
||||
//const { sku = '', title = '' } = props;
|
||||
|
||||
const { updateAmount, updatePrice } = useProductsActions();
|
||||
// const dispatch = useProductsDispatch();
|
||||
// const dispatch = useProductsDispatch(); // const dispatch = useContext(ProductsDispatchContext)
|
||||
|
||||
// Eventhandler
|
||||
// const handleAmount = useCallback((val) => {
|
||||
@@ -23,6 +24,7 @@ const RowProduct = (props) => {
|
||||
const handleAmount = useCallback(
|
||||
(val) => {
|
||||
updateAmount(val, _id);
|
||||
// dispatch({type: PRODUCTS_ACTIONS.UPDATE_AMOUNT, payload: {amount: val, id: _id}})
|
||||
},
|
||||
[updateAmount, _id],
|
||||
);
|
||||
|
||||
@@ -44,6 +44,7 @@ export const useProductsDispatch = () => {
|
||||
return dispatch;
|
||||
};
|
||||
|
||||
// Factory Function
|
||||
export const useProductsActions = () => {
|
||||
const dispatch = useProductsDispatch();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user