Redux: what allows this syntax "static propTypes = {"

Created on 3 Oct 2016  路  9Comments  路  Source: reduxjs/redux

What makes that compile?

Most helpful comment

@keithn It's part of the "Public Class Fields" proposal. In babel it can be enabled with the state-2 preset or the transform-class-properties plugin.

All 9 comments

@keithn It's part of the "Public Class Fields" proposal. In babel it can be enabled with the state-2 preset or the transform-class-properties plugin.

right, seems like there's a lot of stuff in the "Examples" that use things that are not well explained / documented in terms of the build you need to setup.... which kind of defeats the purpose of examples.

Yeah, it's briefly mentioned in the create-react-app readme, near the bottom, but that's not obvious. If you use create-react-app, like the examples do, there's nothing you need to set up; it's included automatically.

@keithn

Examples use Create React App for build setup.
I believe this is mentioned as the very first sentence in the README of every example:

screen shot 2016-10-03 at 15 15 43

Create React App takes care of all build configuration so you don鈥檛 need to configure anything if you use it. You can learn about Create React App in its introductory blog post or its repository.

I will say that we should maybe call out use of non-finalized features in the examples a bit more, for clarity.

I agree. Ideally CRA docs should list supported features beyond ES6 and we should link to that list.

@gaearon @markerikson

A link to the list would be great. While I've been pointed to various bits and pieces, I already have a webpack setup for React that I'm trying to modify so I can use redux, which in itself works ok, but the examples of using redux use language features that are hard to work out exactly how to get them to work.

Would you like to help us out with that? You could look at packages/babel-preset-react-app in Create React App repository, write a list, and add this to its documentation in its user guide linked from the README.

Was the above what you had in mind, @gaearon?
Apologies if I'm a bit off-track here. I'm new to open-source. 馃樃

Was this page helpful?
0 / 5 - 0 ratings

Related issues

elado picture elado  路  3Comments

rui-ktei picture rui-ktei  路  3Comments

benoneal picture benoneal  路  3Comments

vraa picture vraa  路  3Comments

olalonde picture olalonde  路  3Comments