Hey,
I was pretty excited when “learnapollo.com” was released, but the excitement died a fast and painful death.
It was a horror trip to make this simple react tutorial run in meteor… and the trip has no end, since I crash into the wall with each exercise.
If I understand this right, the tutorial is written using the latest ES7 specification, but Meteor supports ES6 only? So many points in this tutorial have to be adjusted to make meteor understand the syntax…
I managed to do so with some points, but since I am a very beginner in the Meteor + React world, I have massive struggles to deal with all the points. So is there a way to use ES7 in meteor?
Points like the following are causing “Missing class properties transform.” errors:
static propTypes = {
data: React.PropTypes.shape({
loading: React.PropTypes.bool,
error: React.PropTypes.object,
Pokemon: React.PropTypes.object,
}).isRequired,
router: React.PropTypes.object.isRequired,
params: React.PropTypes.object.isRequired,
}
solution, do not use static propTypes at all.
goBack = () => {
this.props.router.replace('/')
}
solution: do not use arrow functions use following instead
constructor(props) {
super(props);
this.goBack = this.goBack.bind(this);
}
goBack() {
{
this.props.router.replace('/')
}
}
But how to deal with the following if I am not allowed to use static?
static fragments = {
pokemon: gql`
fragment PokemonCardPokemon on Pokemon {
url
name
}
`
}