Fix React devtools experience

Summary:
Currently most components are shown anonymously in the component tree, because using `styled` creates unnamed components, shown as the HTML elements they result in.

This has two downsides:
1. React errors / warnings are really vague and it is hard to locate where they are coming from
2. The React Devtools don't show which components are rendering.
3. The effect of the latter it is hard to copy-from-example when developing plugins. This leads to a lot of inconsitency and duplication in the layouts of components

Reviewed By: jknoxville

Differential Revision: D18503675

fbshipit-source-id: 5a9ea1765346fb4c6a49e37ffa4d0b4bbcd86587
This commit is contained in:
Michel Weststrate
2019-11-15 02:08:05 -08:00
committed by Facebook Github Bot
parent 24097ea9b2
commit 0a8222410c
62 changed files with 183 additions and 20 deletions

View File

@@ -10,9 +10,12 @@
import styled from 'react-emotion';
import {inputStyle} from './Input';
export default styled('textarea')(({compact}: {compact?: boolean}) => ({
const Textarea = styled('textarea')(({compact}: {compact?: boolean}) => ({
...inputStyle(compact || false),
lineHeight: 'normal',
padding: compact ? '5px' : '8px',
resize: 'none',
}));
Textarea.displayName = 'Textarea';
export default Textarea;