blueberryapps/react-bluekit

PropTypes.shape support is missing.

Closed this issue · 7 comments

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)

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?

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,
}),
 ...

It should be working.

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.

@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.

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

imtoo commented

It seems it solved the problem. Thanks guys!