Reorganised file structure as rails-style
parent
2ff5f08cd6
commit
1a98c9b40e
|
@ -1,9 +1,9 @@
|
|||
import React, {useState} from 'react';
|
||||
import { useSelector, useDispatch } from "react-redux";
|
||||
|
||||
import Todo from "./Todo";
|
||||
import {TodoItem} from "./types";
|
||||
import { ADD_TODO } from "./reducers";
|
||||
import Todo from "../components/todo/Todo";
|
||||
import { TodoItem } from "../state/todo/types";
|
||||
import { ADD_TODO } from "../state/todo/reducers";
|
||||
|
||||
function App() {
|
||||
const [text, setText] = useState("");
|
|
@ -1,6 +1,6 @@
|
|||
import React from "react";
|
||||
import {useDispatch} from "react-redux";
|
||||
import {DELETE_TODO, TOGGLE_TODO} from "./reducers";
|
||||
import { DELETE_TODO, TOGGLE_TODO } from "../../state/todo/reducers";
|
||||
|
||||
interface TodoProps {
|
||||
id: number;
|
|
@ -1,8 +1,8 @@
|
|||
import React from 'react';
|
||||
import ReactDOM from "react-dom";
|
||||
import { Provider } from "react-redux";
|
||||
import { store } from "./store";
|
||||
import App from './App';
|
||||
import { store } from "./state/store";
|
||||
import App from './app/App';
|
||||
|
||||
ReactDOM.render(
|
||||
<Provider store={store}>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { createStore } from "redux";
|
||||
|
||||
import { todoReducer } from "./reducers";
|
||||
import { todoReducer } from "./todo/reducers";
|
||||
|
||||
export const store = createStore(todoReducer);
|
Loading…
Reference in New Issue