-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2845 from plotly/master2.17.0
Master 2.17.0
- Loading branch information
Showing
93 changed files
with
62,693 additions
and
59,703 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
@plotly/dash-test-components/src/components/AddPropsComponent.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from "react"; | ||
import PropTypes from "prop-types"; | ||
|
||
const AddPropsComponent = (props) => { | ||
const {children, id} = props; | ||
|
||
|
||
return ( | ||
<div id={id}> | ||
{React.cloneElement(children, { | ||
receive: `Element #${id} pass`, | ||
id: id, | ||
})} | ||
</div> | ||
); | ||
}; | ||
|
||
AddPropsComponent.propTypes = { | ||
id: PropTypes.string, | ||
children: PropTypes.node, | ||
}; | ||
|
||
export default AddPropsComponent; |
15 changes: 15 additions & 0 deletions
15
@plotly/dash-test-components/src/components/DrawCounter.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React, { useState, useEffect } from "react"; | ||
import PropTypes from "prop-types"; | ||
|
||
const DrawCounter = (props) => { | ||
const [count, setCount] = useState(0); | ||
useEffect(() => { | ||
setCount(count + 1); | ||
}, [props]); | ||
return <div id={props.id}>{count}</div>; | ||
}; | ||
|
||
DrawCounter.propTypes = { | ||
id: PropTypes.string, | ||
}; | ||
export default DrawCounter; |
19 changes: 19 additions & 0 deletions
19
@plotly/dash-test-components/src/components/ReceivePropsComponent.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
const ReceivePropsComponent = (props) => { | ||
const {id, text, receive} = props; | ||
|
||
return ( | ||
<div id={id}> | ||
{receive || text} | ||
</div> | ||
); | ||
} | ||
ReceivePropsComponent.propTypes = { | ||
id: PropTypes.string, | ||
text: PropTypes.string, | ||
receive: PropTypes.string, | ||
} | ||
|
||
export default ReceivePropsComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.