Commit 28105f5b authored by bekzat kapan's avatar bekzat kapan

#7 Обернул не главную компоненту, а layout, так как иначе вызывает ошибки

parent ad612b98
"use client";
import { store } from "@/store/store";
import { Provider } from "react-redux";
export default function RootLayout({ export default function RootLayout({
children, children,
...@@ -5,10 +8,10 @@ export default function RootLayout({ ...@@ -5,10 +8,10 @@ export default function RootLayout({
children: React.ReactNode; children: React.ReactNode;
}>) { }>) {
return ( return (
<Provider store={store}>
<html lang="en"> <html lang="en">
<body> <body>{children}</body>
{children}
</body>
</html> </html>
</Provider>
); );
} }
...@@ -5,8 +5,6 @@ import { ChangeEvent, useEffect, useState } from 'react'; ...@@ -5,8 +5,6 @@ import { ChangeEvent, useEffect, useState } from 'react';
import InputField from './components/InputField'; import InputField from './components/InputField';
import '@/animations/Loader.css'; import '@/animations/Loader.css';
import { useAppDispatch, useAppSelector } from '@/store/hooks'; import { useAppDispatch, useAppSelector } from '@/store/hooks';
import { Provider } from 'react-redux';
import { store } from '@/store/store';
import { encodeMessage, decodeMessage } from '@/features/requestSlice'; import { encodeMessage, decodeMessage } from '@/features/requestSlice';
interface IFormData { interface IFormData {
...@@ -72,7 +70,7 @@ export default function Home() { ...@@ -72,7 +70,7 @@ export default function Home() {
}; };
return ( return (
<Provider store={store}>
<div className="App"> <div className="App">
<Container sx={{ marginTop: 2 }} maxWidth="lg"> <Container sx={{ marginTop: 2 }} maxWidth="lg">
<Typography <Typography
...@@ -181,6 +179,5 @@ export default function Home() { ...@@ -181,6 +179,5 @@ export default function Home() {
{error && <Typography color="error">{error}</Typography>} {error && <Typography color="error">{error}</Typography>}
</Container> </Container>
</div> </div>
</Provider>
); );
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment