myfirst-react-component
v1.0.1
Published
my first react component
Downloads
3
Readme
myfirst-react-component
my first react component
Installation
npm install --save myfirst-react-component
How To Use
First import this component where you want to use it
import ReactColorSquare from "myfirst-react-component"
Then just renders it
<ReactColorSqaure />
Props
| Prop | Description | Default value | | ------ | :-------------------: | :-------------: | | color | Sets background color | blue | | width | Sets width | 100 | | height | Sets height | 100 | | text | Sets inner text | empty string |
Example
import React, { Component } from "react";
import ReactColorSquare from "myfirst-react-component";
class App extends Component {
render() {
return (
<ReactColorSquare height={150} color="red" text="Hello World!" />
);
}
}
export default App;