diff --git a/packages/samples/headless-commerce-react/.eslintrc.json b/packages/samples/headless-commerce-react/.eslintrc.json new file mode 100644 index 00000000000..f2b963db013 --- /dev/null +++ b/packages/samples/headless-commerce-react/.eslintrc.json @@ -0,0 +1,6 @@ +{ + "extends": ["plugin:@typescript-eslint/recommended"], + "parser": "@typescript-eslint/parser", + "plugins": ["@typescript-eslint"], + "root": true +} diff --git a/packages/samples/headless-commerce-react/src/components/breadcrumb-manager/breadcrumb-manager.tsx b/packages/samples/headless-commerce-react/src/components/breadcrumb-manager/breadcrumb-manager.tsx index 020c674f40d..6bb726765a3 100644 --- a/packages/samples/headless-commerce-react/src/components/breadcrumb-manager/breadcrumb-manager.tsx +++ b/packages/samples/headless-commerce-react/src/components/breadcrumb-manager/breadcrumb-manager.tsx @@ -18,7 +18,7 @@ export default function BreadcrumbManager(props: BreadcrumbManagerProps) { const [state, setState] = useState(controller.state); useEffect(() => { - controller.subscribe(() => setState(controller.state)); + controller.subscribe(() => setState({...controller.state})); }, [controller]); if (!state.hasBreadcrumbs) { @@ -57,14 +57,17 @@ export default function BreadcrumbManager(props: BreadcrumbManagerProps) {