Skip to content

Instantly share code, notes, and snippets.

@tosipaulo
Created October 14, 2017 15:07
Show Gist options
  • Save tosipaulo/e6e97a3eb380a0d04cd842aa58b7199e to your computer and use it in GitHub Desktop.
Save tosipaulo/e6e97a3eb380a0d04cd842aa58b7199e to your computer and use it in GitHub Desktop.
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