From 310a76d03f91f3a78166ff4e840b9f51dd535464 Mon Sep 17 00:00:00 2001 From: Michel Weststrate Date: Tue, 19 May 2020 05:31:05 -0700 Subject: [PATCH] Improve standard view template Summary: As soon as any data was send to a freshly generated plugin, the plugin would crash as React doesn't support directly rendering data. Replaced it with a poor mans rendering that simply dumps all the data we received. Also made sure the view is scrollable now which wasn't the case before. Reviewed By: jknoxville Differential Revision: D21523816 fbshipit-source-id: 3e04799facdf8b66ce9d66217a47fc7826d58d43 --- desktop/pkg/templates/plugin/src/index.tsx.template | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/desktop/pkg/templates/plugin/src/index.tsx.template b/desktop/pkg/templates/plugin/src/index.tsx.template index cf1abed5e..3b20dcfe8 100644 --- a/desktop/pkg/templates/plugin/src/index.tsx.template +++ b/desktop/pkg/templates/plugin/src/index.tsx.template @@ -1,5 +1,5 @@ import React from 'react'; -import {FlipperPlugin, FlexColumn, KeyboardActions} from 'flipper'; +import {FlipperPlugin, View, KeyboardActions} from 'flipper'; type State = {}; @@ -37,11 +37,11 @@ export default class extends FlipperPlugin { render() { return ( - + {this.props.persistedState.data.map((d) => ( -
{d}
+
{JSON.stringify(d, null, 2)}
))} -
- ); + + ) } }