inokawa/react-native-react-bridge

webViewRender: Import statement may only appear at top level

ttraenkler opened this issue · 3 comments

I've bootstrapped a new react native project with expo managed workflow minimal typescript template and importing fine with

import {
	webViewRender,
	emit,
	useSubscribe,
} from "react-native-react-bridge/lib/web";

however, when invoking webViewRender

export default webViewRender(<div>a</div>);

transform fails with

Failed building JavaScript bundle.
WebApp.tsx: WebApp.tsx: Import statement may only appear at top level in file WebApp.tsx at 4:2

Hi, @ttraenkler ,
It sounds similar to #18 so #18 (comment) may be a workaround.

Of course it should work with the original preset so I'll try to fix the problem.

@ttraenkler
Fixed in 0.6.0. Thank you for your reporting!

Nice, that was quick - thanks a lot! 👍