brh55 / react-native-masonry

:raised_hands: A pure JS react-native component to render a masonry~ish layout for images with support for dynamic columns, progressive image loading, device rotation, on-press handlers, and headers/captions.
MIT License
1.32k stars 157 forks source link

TouchableHighlights child and style overide #49

Closed srameshr closed 7 years ago

srameshr commented 7 years ago

Bug when onPress is added due to immediate child not being react native element.

brh55 commented 7 years ago

@srameshr Can you check what's causing the unit test to fail out?

srameshr commented 7 years ago

@brh55

 FAIL  __tests__/brick.test.js (7.259s)
  ● PRIVATE FUNC: Renders touchable tag properly
    expect(received).toEqual(expected)

    Expected value to equal:
      "{\"key\":\"http://test1.jpg\",\"ref\":null,\"props\":{\"children\":{\"key\":null,\"ref\":null,\"props\":{\"defaultProps\":{\"key\":\"http://test1.jpg\",\"source\":{\"uri\":\"http://test1.jpg\"},\"resizeMethod\":\"auto\",\"style\":{\"width\":100,\"height\":200,\"marginTop\":9}}},\"_owner\":null,\"_store\":{}},\"activeOpacity\":0.85,\"underlayColor\":\"black\"},\"_owner\":null,\"_store\":{}}"
    Received:
      "{\"key\":\"http://test1.jpg\",\"ref\":null,\"props\":{\"children\":{\"key\":null,\"ref\":null,\"props\":{\"children\":{\"key\":null,\"ref\":null,\"props\":{\"defaultProps\":{\"key\":\"http://test1.jpg\",\"source\":{\"uri\":\"http://test1.jpg\"},\"resizeMethod\":\"auto\",\"style\":{\"width\":100,\"height\":200,\"marginTop\":9}}},\"_owner\":null,\"_store\":{}}},\"_owner\":null,\"_store\":{}},\"activeOpacity\":0.85,\"underlayColor\":\"black\"},\"_owner\":null,\"_store\":{}}"

      at Object.<anonymous> (__tests__/brick.test.js:36:34)
      at tryCallTwo (node_modules/promise/lib/core.js:45:5)
      at doResolve (node_modules/promise/lib/core.js:200:13)
      at new Promise (node_modules/promise/lib/core.js:66:3)
      at Promise.resolve.then.el (node_modules/p-map/index.js:46:16)
      at tryCallOne (node_modules/promise/lib/core.js:37:12)
      at node_modules/promise/lib/core.js:123:15

Il fix the text case.