Skip to content

Instantly share code, notes, and snippets.

@nolimits4web
Created December 31, 2020 11:49
Show Gist options
  • Save nolimits4web/14eb293779d2568c99237e1c73d9f120 to your computer and use it in GitHub Desktop.
Save nolimits4web/14eb293779d2568c99237e1c73d9f120 to your computer and use it in GitHub Desktop.
Framework7 v6 JSX Component
export default (props, { $f7, $on, $update }) => {
let foo = 'bar';
const items = [
{
title: 'Item 1'
},
{
title: 'Item 2'
},
];
const changeValue = () => {
foo = 'bar 2';
$update();
}
$on('pageInit', () => {
$f7.dialog.alert('page init')
})
return () => (
<div class="page">
<p>Value is: {foo}</p>
<p>
<a href="#" onClick={changeValue}>Change value</a>
</p>
<ul>
{items.map((item) => (
<li>{item.title}</li>
))}
</ul>
</div>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment