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