amp-react-components
Advanced tools
Comparing version 1.5.0 to 1.5.1
@@ -0,1 +1,5 @@ | ||
## <small>1.5.1 (2019-10-21)</small> | ||
* fix: add ampSetState util function ([22712cd](https://github.com/danhuang1202/amp-react-components/commit/22712cd)) | ||
## 1.5.0 (2019-10-15) | ||
@@ -2,0 +6,0 @@ |
@@ -34,4 +34,4 @@ import commonjs from 'rollup-plugin-commonjs' | ||
const viewPath = path.join(__dirname, '../src/components/view/') | ||
fs.readdirSync(viewPath).forEach(filename => { | ||
const componentViewPath = path.join(__dirname, '../src/components/view/') | ||
fs.readdirSync(componentViewPath).forEach(filename => { | ||
entries.push({ | ||
@@ -52,4 +52,4 @@ input: `src/components/view/${filename}`, | ||
const utilPath = path.join(__dirname, '../src/components/util/') | ||
fs.readdirSync(utilPath).forEach(filename => { | ||
const componentUtilPath = path.join(__dirname, '../src/components/util/') | ||
fs.readdirSync(componentUtilPath).forEach(filename => { | ||
entries.push({ | ||
@@ -70,2 +70,19 @@ input: `src/components/util/${filename}`, | ||
const utilPath = path.join(__dirname, '../src/utils/') | ||
fs.readdirSync(utilPath).forEach(filename => { | ||
entries.push({ | ||
input: `src/utils/${filename}`, | ||
output: [ | ||
{ | ||
dir: `lib/utils`, | ||
format: 'cjs' | ||
}, | ||
{ | ||
dir: `es/utils`, | ||
format: 'es' | ||
} | ||
] | ||
}) | ||
}) | ||
const options = entries.map(entry => { | ||
@@ -72,0 +89,0 @@ const { input, output } = entry |
{ | ||
"name": "amp-react-components", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"description": "Render AMP components with React", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -110,2 +110,3 @@ # amp-react-components | ||
function Compoment({...}) { | ||
@@ -136,2 +137,20 @@ const id = "myAnimals" | ||
} | ||
``` | ||
- AMP.setState | ||
```js | ||
import { ampSetState } from 'amp-react-components/utils' | ||
function Button(){ | ||
const state = { | ||
foo: 'bar' | ||
} | ||
return ( | ||
<button | ||
on=`tap:${ampSetState(state)}` | ||
> | ||
click me | ||
</button> | ||
) | ||
} | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
538767
398
16428
154