Skip to content

Commit 21ee97d

Browse files
committed
migrate usage.py to dash 2.0
1 parent 6bc7922 commit 21ee97d

File tree

1 file changed

+3
-5
lines changed
  • {{cookiecutter.project_shortname}}

1 file changed

+3
-5
lines changed

{{cookiecutter.project_shortname}}/usage.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import {{cookiecutter.project_shortname}}
2-
import dash
3-
from dash.dependencies import Input, Output
4-
import dash_html_components as html
2+
from dash import Dash, callback, html, Input, Output
53

6-
app = dash.Dash(__name__)
4+
app = Dash(__name__)
75

86
app.layout = html.Div([
97
{{cookiecutter.project_shortname}}.{{cookiecutter.component_name}}(
@@ -15,7 +13,7 @@
1513
])
1614

1715

18-
@app.callback(Output('output', 'children'), [Input('input', 'value')])
16+
@callback(Output('output', 'children'), Input('input', 'value'))
1917
def display_output(value):
2018
return 'You have entered {}'.format(value)
2119

0 commit comments

Comments
 (0)