I have a problem to indicate a property of type "enum" in the reaction. According to the documentation here, the following snippet should work on several components :
position : React.PropTypes.oneOf(['rightTop','rightBottom'])
But I get the following error
ERROR in ./app/components/mqttComponents/mqttPresence.jsx Module build failed: SyntaxError:/Users/giuseppe/Projects/sw-director/app/components/mqttComponents/mqttPresence.jsx: Unexpected token (68:36) 66 | propTypes : { 67 | //position: React.PropTypes.string.isRequired, > 68 | position : React.PropTypes.oneOf(['rightTop','rightBottom']), ^ 69 | showMqttClientStatus : React.PropTypes.bool.isRequired, 70 | mqtt: React.PropTypes.object 71 | }
I donβt understand, what is the mistake? Maybe something has to do with the new ES6 syntax?
source share