import React from 'react';
import ReactDOM from 'react-dom';
import TextareaAutosize from '../src/TextareaAutosize';

class Example extends React.Component {

  constructor(props) {
    super(props);
    this.state = {
      value: 'replace me with your component'
    };
  }

  render() {

    const textareaStyle = {
      padding: '10px 8px',
      border: '1px solid rgba(39,41,43,.15)',
      borderRadius: 4,
      fontSize: 15
    };

    return (
      <div style={{ fontFamily: 'sans-serif', margin: 15 }}>
        <h2>Empty</h2>
        <TextareaAutosize style={textareaStyle} placeholder='try writing some lines' />

        <h2>Minimum Height</h2>
        <TextareaAutosize rows='3' style={textareaStyle} placeholder='minimun height is 3 rows' />

        <h2>Prefilled</h2>
        <TextareaAutosize style={textareaStyle} defaultValue={'this\nis\na\nlong\ninitial\ntext'} />

        <h2>{'You can compare with this normal react <textarea>'}</h2>
        <textarea style={textareaStyle} defaultValue={'this\nis\na\nlong\ninitial\ntext'} />
      </div>
    );
  }

}

ReactDOM.render(<Example />, document.getElementById('container'));

@@ -158,148 +158,8 @@
 %0A%0A  
-constructor(props) %7B%0A    super(props);%0A    this.state = %7B%0A      value: 'replace me with your component'%0A    %7D;%0A  %7D%0A%0A  render() %7B%0A%0A    const 
 text
@@ -172,18 +172,16 @@
 yle = %7B%0A
-  
     padd
@@ -197,26 +197,24 @@
 x 8px',%0A    
-  
 border: '1px
@@ -232,23 +232,24 @@
 (39,
+ 
 41,
+ 
 43,
+ 
 .15)',%0A
-  
     
@@ -269,18 +269,16 @@
  4,%0A    
- 
- 
 fontSize
@@ -288,18 +288,117 @@
 5%0A  
-  %7D;%0A%0A 
+%7D%0A%0A  onResize = (event) =%3E %7B%0A    console.log(event); // eslint-disable-line no-console%0A  %7D%0A%0A  render() %7B%0A
    
+ 
 retu
@@ -479,13 +479,40 @@
 %3Ch2%3E
-Empty
+%7B'Plain %22%3CTextareaAutosize /%3E%22'%7D
 %3C/h2
@@ -534,32 +534,42 @@
 areaAutosize
+%0A         
  style=%7B
 textareaStyl
@@ -548,32 +548,37 @@
          style=%7B
+this.
 textareaStyle%7D p
@@ -567,32 +567,42 @@
 s.textareaStyle%7D
+%0A         
  placeholder='tr
@@ -622,16 +622,59 @@
 e lines'
+%0A          onResize=%7Bthis.onResize%7D%0A       
  /%3E%0A%0A   
@@ -694,14 +694,26 @@
 mum 
-H
+h
 eight
+ is 3 %22rows%22
 %3C/h2
@@ -743,25 +743,45 @@
 size
- rows='3'
+%0A          rows='3'%0A         
  style=%7B
 text
@@ -768,32 +768,37 @@
          style=%7B
+this.
 textareaStyle%7D p
@@ -795,16 +795,26 @@
 eaStyle%7D
+%0A         
  placeho
@@ -844,16 +844,24 @@
  3 rows'
+%0A       
  /%3E%0A%0A   
@@ -878,16 +878,35 @@
 refilled
+ with initial value
 %3C/h2%3E%0A  
@@ -928,24 +928,34 @@
 Autosize
+%0A         
  style=%7B
 textarea
@@ -938,32 +938,37 @@
          style=%7B
+this.
 textareaStyle%7D d
@@ -957,32 +957,42 @@
 s.textareaStyle%7D
+%0A         
  defaultValue=%7B'
@@ -1021,24 +1021,32 @@
 tial%5Cntext'%7D
+%0A       
  /%3E%0A%0A       
@@ -1091,16 +1091,17 @@
 l react 
+%22
 %3Ctextare
@@ -1101,17 +1101,21 @@
 textarea
-%3E
+ /%3E%22%22
 '%7D%3C/h2%3E%0A
@@ -1131,24 +1131,34 @@
 textarea
+%0A         
  style=%7B
 textarea
@@ -1149,16 +1149,21 @@
  style=%7B
+this.
 textarea
@@ -1168,16 +1168,26 @@
 eaStyle%7D
+%0A         
  default
@@ -1228,16 +1228,24 @@
 %5Cntext'%7D
+%0A       
  /%3E%0A    

clean examples.js code