I want to give my new React
app a consistent look and feel using Material-UI
. Also, I want the styles and such to be easily maintainable. So the default theme seems like a pretty good start. The cssBaseline
offered by Material-UI
seems to check all the boxes, so I want to give it a try. The thing is, surprise, it's not working. Css themes aren't really my thing. Am I misguided here or what? The following code is what I've implemented in my App.js component with no luck (taken from here ). I'm hoping is just an implmentation detail.
import React from "react";
import Footer from "./Footer";
import CssBaseline from "@material-ui/core/CssBaseline";
import AddTodo from "../containers/AddTodo";
import VisibleTodoList from "../containers/VisibleTodoList";
const App = () => (
<React.Fragment>
<CssBaseline />
<div>
<AddTodo />
<VisibleTodoList />
<Footer />
</div>
</React.Fragment>
);
export default App;
EDIT: This is the index.js
located in the root of the project:
import React from "react";
import { render } from "react-dom";
import { createStore, applyMiddleware } from "redux";
import { Provider } from "react-redux";
import App from "./components/App";
import rootReducer from "./reducers";
const store = createStore(rootReducer);
render(
<Provider store={store}>
<MuiThemeProvider theme={theme}>
<React.Fragment>
<CssBaseline />
<App />
</React.Fragment>
</MuiThemeProvider>
</Provider>,
document.getElementById("root")
);
EDIT: My new App.js
import React from "react";
import Footer from "./Footer";
import AddTodo from "../containers/AddTodo";
import AppBar from "../components/AppBar";
import VisibleTodoList from "../containers/VisibleTodoList";
const App = () => (
<div>
<AppBar />
<AddTodo />
<VisibleTodoList />
<Footer />
</div>
);
export default App;