Static container for react.
npm install @jswork/react-static-container[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]
shell
npm install -S @jswork/react-static-container
`properties
| Name | Type | Required | Default | Description |
| ------- | ----- | -------- | -------------- | -------------------------- |
| as | any | false | React.Fragment | The static node name. |
| deps | array | false | [] | The deps of the component. |
| dynamic | bool | false | false | The default should update. |
usage
1. import css
`scss
@import "~@jswork/boilerplate-react-component/dist/style.css"; // or use sass
@import "~@jswork/boilerplate-react-component/dist/style.scss";
// customize your styles:
$boilerplate-react-component-options: ()
`
2. import js
`js
import React, { useState } from 'react';
import ReactStaticContainer from '../@jswork/boilerplate-react-component';
import styled from 'styled-components'; const Container = styled.div
; export default (props: any) => {
const [count, setCount] = useState(10);
const [id, setId] = useState(0);
return (
I can not change.(except the first time.)
{count}
I can change.(Because i have deps changed.)
{count}
I can change {count}
);
};
``[version-image]: https://img.shields.io/npm/v/@jswork/react-static-container
[version-url]: https://npmjs.org/package/@jswork/react-static-container
[license-image]: https://img.shields.io/npm/l/@jswork/react-static-container
[license-url]: https://github.com/afeiship/react-static-container/blob/master/LICENSE.txt
[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/react-static-container
[size-url]: https://github.com/afeiship/react-static-container/blob/master/dist/react-static-container.min.js
[download-image]: https://img.shields.io/npm/dm/@jswork/react-static-container
[download-url]: https://www.npmjs.com/package/@jswork/react-static-container