diff --git a/CHANGELOG.md b/CHANGELOG.md index ecbf1be..77bfd60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [0.13.2] - 2018-07-24 +### Fixed +- Attempting to render a `Boolean` value to the page no longer crashes the app. + ## [0.13.1] - 2018-07-18 ### Fixed - If a callback references an `id` which does not exist in the DOM tree at the time it is executed, throw an informative front-end exception (previously an uninformative front-end exception was thrown). https://github.com/plotly/dash-renderer/issues/57 diff --git a/src/TreeContainer.js b/src/TreeContainer.js index 5c827d2..5250d6c 100644 --- a/src/TreeContainer.js +++ b/src/TreeContainer.js @@ -21,7 +21,7 @@ TreeContainer.propTypes = { } function render(component) { - if (R.contains(R.type(component), ['String', 'Number', 'Null'])) { + if (R.contains(R.type(component), ['String', 'Number', 'Null', 'Boolean'])) { return component; } @@ -39,7 +39,7 @@ function render(component) { } else if (R.contains( R.type(component.props.children), - ['String', 'Number', 'Null']) + ['String', 'Number', 'Null', 'Boolean']) ) { children = [component.props.children]; diff --git a/tests/test_render.py b/tests/test_render.py index 0a3f946..dc1c68e 100644 --- a/tests/test_render.py +++ b/tests/test_render.py @@ -73,38 +73,39 @@ def test_initial_state(self): app.layout = html.Div([ 'Basic string', 3.14, + True, None, html.Div('Child div with basic string', - id='p.c.3', + id='p.c.4', className="my-class", title='tooltip', style={'color': 'red', 'fontSize': 30} ), - html.Div(id='p.c.4'), + html.Div(id='p.c.5'), html.Div([ - html.Div('Grandchild div', id='p.c.5.p.c.0'), + html.Div('Grandchild div', id='p.c.6.p.c.0'), html.Div([ - html.Div('Great grandchild', id='p.c.5.p.c.1.p.c.0'), + html.Div('Great grandchild', id='p.c.6.p.c.1.p.c.0'), 3.14159, 'another basic string' - ], id='p.c.5.p.c.1'), + ], id='p.c.6.p.c.1'), html.Div([ html.Div( html.Div([ html.Div([ html.Div( - id='p.c.5.p.c.2.p.c.0.p.c.p.c.0.p.c.0' + id='p.c.6.p.c.2.p.c.0.p.c.p.c.0.p.c.0' ), '', html.Div( - id='p.c.5.p.c.2.p.c.0.p.c.p.c.0.p.c.2' + id='p.c.6.p.c.2.p.c.0.p.c.p.c.0.p.c.2' ) - ], id='p.c.5.p.c.2.p.c.0.p.c.p.c.0') - ], id='p.c.5.p.c.2.p.c.0.p.c'), - id='p.c.5.p.c.2.p.c.0' + ], id='p.c.6.p.c.2.p.c.0.p.c.p.c.0') + ], id='p.c.6.p.c.2.p.c.0.p.c'), + id='p.c.6.p.c.2.p.c.0' ) - ], id='p.c.5.p.c.2') - ], id='p.c.5') + ], id='p.c.6.p.c.2') + ], id='p.c.6') ]) self.startServer(app) @@ -122,16 +123,16 @@ def test_initial_state(self): Child div with basic string -