Closed bramp closed 11 months ago
It's unclear if this is intentional, but when hot-reloading, the Stories are rebuilt causing any Stateful widgets to lose their state and reload.
return Storybook( stories: [ Story( name: 'Test, builder: (context) { return TestWidget(); } ) ] );
class TestWidget extends StatefulWidget { const TestWidget({super.key}); @override State<TestWidget> createState() => _TestWidgetState(); } class _TestWidgetState extends State<TestWidget> { @override initState() { super.initState(); print('initState'); } @override Widget build(BuildContext context) { return const Placeholder(); } }
Hot-reload is meant to preserve state, so is this a bug? or intentional feature to help in testing stateful widgets?
You know what, this might be a problem I've caused outside of Storybook. Sorry for the noise.
It's unclear if this is intentional, but when hot-reloading, the Stories are rebuilt causing any Stateful widgets to lose their state and reload.
Hot-reload is meant to preserve state, so is this a bug? or intentional feature to help in testing stateful widgets?