Skip to content

Commit

Permalink
fix: add basic.tsx, which was missing
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenbreddels committed Nov 26, 2023
1 parent 40c05f4 commit 58e9a24
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
10 changes: 10 additions & 0 deletions ipyreact/basic.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Button from '@mui/material/Button';
import confetti from "canvas-confetti";

import * as React from "react";
export default function({value, on_value, debug}) {
if(debug) {
console.log("value=", value, on_value);
}
return <Button variant="contained" onClick={() => confetti() && on_value(value + 1)}>{value || 0} times confetti</Button>
};
8 changes: 1 addition & 7 deletions ipyreact/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,7 @@ class ReactWidget(anywidget.AnyWidget):
"scopes": {
},
}
_esm = """
import * as React from "react";
export default function App() {
<p>Welcome to ipyreact!</p>
}
"""
_esm = HERE / Path("basic.tsx")

def __init__(self, **kwargs) -> None:
_import_map = kwargs.pop("_import_map", {})
Expand Down

0 comments on commit 58e9a24

Please sign in to comment.