Storybook: react-native doesn't export "raw" function

Created on 8 Mar 2019  路  3Comments  路  Source: storybookjs/storybook

Description
Running snapshot tests with react-native receive the following error description:
"TypeError: storybook.raw is not a function"

Looking at the storybook/react-native package it doesn't export a "raw" function
https://github.com/storybooks/storybook/blob/next/app/react-native/src/index.js

storybook/react does export a "raw" function
https://github.com/storybooks/storybook/blob/next/app/react/src/client/index.js

The loader process returns a storybook/preview instance that expects the raw function:
https://github.com/storybooks/storybook/blob/next/addons/storyshots/storyshots-core/src/api/index.js#L46

It appears the preview code in storybook/react-native is the area this should be addressed but I haven't had a chance to clone and do some testing. If anyone has any ideas or can point me to the right area I can put together a PR to address this.

Thanks

storyshots react-native bug core

Most helpful comment

This was fixed in https://github.com/storybooks/storybook/pull/6182 and released in 5.1.0-alpha.10

All 3 comments

Is there a workaround?

Not that I've found. We've disabled all RN storyshots for now. I attempted to run the CRA native example app as a debugging avenue but couldn't get it running (unrelated to this issue). I'm not sure the example app has been updated recently. Unfortunately I had to move on for the time being.

This was fixed in https://github.com/storybooks/storybook/pull/6182 and released in 5.1.0-alpha.10

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ZigGreen picture ZigGreen  路  3Comments

shilman picture shilman  路  3Comments

tomitrescak picture tomitrescak  路  3Comments

sakulstra picture sakulstra  路  3Comments

miljan-aleksic picture miljan-aleksic  路  3Comments