diff --git a/src/App.js b/src/App.js index 2c656f8..dfb78fc 100644 --- a/src/App.js +++ b/src/App.js @@ -1,8 +1,18 @@ -import React, { Component } from 'react'; -import logo from './logo.svg'; -import './App.css'; +import React, { Component } from 'react' +import logo from './logo.svg' +import './App.css' class App extends Component { + componentDidMount() { + console.log('fetch items') + fetch('https://adoring-clarke-f30908.netlify.com/.netlify/functions/todos-read-all') + .then((response) => { + return response.json() + }) + .then((myJson) => { + console.log(myJson) + }) + } render() { return (
@@ -14,8 +24,8 @@ class App extends Component { Using FaunaDB & netlify functions

- ); + ) } } -export default App; +export default App diff --git a/src/App.test.js b/src/App.test.js index a754b20..4bf1935 100644 --- a/src/App.test.js +++ b/src/App.test.js @@ -1,9 +1,9 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import App from './App'; +import React from 'react' +import ReactDOM from 'react-dom' +import App from './App' it('renders without crashing', () => { - const div = document.createElement('div'); - ReactDOM.render(, div); - ReactDOM.unmountComponentAtNode(div); -}); + const div = document.createElement('div') + ReactDOM.render(, div) + ReactDOM.unmountComponentAtNode(div) +}) diff --git a/src/index.js b/src/index.js index 395b749..49624cc 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,6 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import './index.css'; -import App from './App'; +import React from 'react' +import ReactDOM from 'react-dom' +import './index.css' +import App from './App' -ReactDOM.render(, document.getElementById('root')); +ReactDOM.render(, document.getElementById('root'))