Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PropTypes.shape support is missing. #96

Closed
40818419 opened this issue Jan 23, 2017 · 7 comments
Closed

PropTypes.shape support is missing. #96

40818419 opened this issue Jan 23, 2017 · 7 comments

Comments

@40818419
Copy link

PropsTable.react.js:127
Uncaught TypeError: data.getIn is not a function
    at RadiumEnhancer.renderPropTableRow (http://localhost:8080/dist/example.js:64575:24)
    at http://localhost:8080/dist/example.js:43414:47
    at BitmapIndexedNode.iterate.HashArrayMapNode.iterate (http://localhost:8080/dist/example.js:42135:25)
    at Map.__iterate (http://localhost:8080/dist/example.js:41773:33)
    at http://localhost:8080/dist/example.js:41620:17
    at Map.withMutations (http://localhost:8080/dist/example.js:41751:8)
    at Array.map (native)
    at RadiumEnhancer.render (http://localhost:8080/dist/example.js:64549:26)
    at RadiumEnhancer.render (http://localhost:8080/dist/example.js:45627:66)
    at measureLifeCyclePerf (http://localhost:8080/dist/example.js:23563:13)
@ondrejbartas
Copy link
Contributor

Hi, this is strange. PropType.shape should be working. We have some examples whit it.

https://github.com/blueberryapps/react-bluekit/blob/master/example_components/MultiField.react.js#L13-L17

can you send your propTypes pls?

@40818419
Copy link
Author

40818419 commented Jan 23, 2017

Ah... i have it like this:

...
options: PropTypes.shape({
  fontFamily: PropTypes.string,
  borderRadius: PropTypes.string,
  border: PropTypes.string,
  boxShadow: PropTypes.string,
  margin: PropTypes.string,
  paddingLeft: PropTypes.string,
  width: PropTypes.string,
  height: PropTypes.string,
  fontSize: PropTypes.string,
  backgroundColor: PropTypes.string,
  color: PropTypes.string,
}),
 ...

@ondrejbartas
Copy link
Contributor

It should be working.

@apfelfabrik
Copy link
Contributor

apfelfabrik commented Mar 14, 2017

Found this issue when running in a very similar problem: Uncaught TypeError: data.getIn is not a function related to a component using PropTypes.shape. This is on 0.4.1.

@apfelfabrik
Copy link
Contributor

@ondrejbartas The example you posted above works because arrayOf renders a JSON editor without respecting the contained propType. Using PropTypes.shape as a first level prop consistently fails with the error @40818419 reported and I'm experiencing.

@apfelfabrik
Copy link
Contributor

PR might illustrate the problem, not sure this restores the intended behaviour though.

@imtoo
Copy link
Contributor

imtoo commented Mar 19, 2017

It seems it solved the problem. Thanks guys!

@imtoo imtoo closed this as completed Mar 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants