Created
October 14, 2017 15:07
-
-
Save tosipaulo/e6e97a3eb380a0d04cd842aa58b7199e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react' | |
import {Link} from 'react-router-dom' | |
import api from './Api' | |
class Cakes extends Component { | |
constructor(props){ | |
super(props) | |
} | |
componentDidMount(){ | |
api.loadCategories() | |
.then((res) => { | |
return res.data.filter((item) => item.slug === this.props.match.params.slug) | |
}).then((data) => console.log(console.log(data))) | |
} | |
render() { | |
return ( | |
<div> | |
{this.props.match.params.slug} | |
</div> | |
) | |
} | |
} | |
export default Cakes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment