-
-
Notifications
You must be signed in to change notification settings - Fork 49
Fix props generation. #84
Conversation
@rmarren1 Please review |
One possible problem:
as opposed to React 15 which does not do this
basically this: https://reactjs.org/blog/2017/09/08/dom-attributes-in-react-16.html If somebody is building a Dash app using React 16 and has something dependent on this rendering functionality (e.g. a Selenium test which clicks a button and makes sure the There may be 0 such cases, but it is possible. Does this change have any functional impact? I'd prefer to wait until 1.0 to be careful if it does not. |
Right now dash app only runs on react 15 so nobody has anything that depends on this, we tests those using output to children. I also don't think it's a good idea to write those props to the DOM, they are included in all html props with a default and the write operation on the DOM still has a performance overhead. |
You can use react 16 by setting the dash version on the renderer here An example app:
The DOM contains those props now: We don't use test using these, but it is possible that somebody could be testing this way using a webdriver, and this change would break. I'm thinking of something similar to this test where a DOM element is taken by |
That is only valid for testing and there are other way to test it. I mean those props will be written everywhere, even for html element that are not clickable so it doesn't make sense to write them to the DOM for all of them. |
@rmarren1 @T4rk1n If someone wrote a test dependent on the presence of the prop in the react data structure accessible from the DOM, this makes their test dependent on internal implementation details of React, and it does not make much sense for us to support a hack test case. This test can easily be done by either hooking up to a Dash callback or by adding a spy on 'click' and checking the count. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💃
That makes sense, was being a bit pedantic 💃 |
n_clicks
/n_clicks_timestamp
had a wrong PropTypeinteger
changed to number.n_clicks
/n_clicks_timestamp
from wrapped element props.