Skip to content

Commit

Permalink
fix jsx console warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
zaliqarosli committed Dec 7, 2023
1 parent 07126cf commit e3b0cd2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion jsx/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,10 @@ export class FieldsetElement extends Component {
FieldsetElement.propTypes = {
columns: PropTypes.number,
name: PropTypes.string,
legend: PropTypes.string,
legend: PropTypes.oneOfType([
PropTypes.string,
PropTypes.node,
]),
children: PropTypes.node,
};

Expand Down
8 changes: 4 additions & 4 deletions modules/candidate_parameters/jsx/DiagnosisEvolution.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ class DiagnosisEvolution extends Component {
let formattedDxEvolution = [];
dxEvolution.map((record) => {
let formattedDiagnosis = [];
Object.entries(JSON.parse(record.Diagnosis)).map((entry) => {
Object.entries(JSON.parse(record.Diagnosis)).map((entry, index) => {
const [fieldName, dx] = entry;
formattedDiagnosis.push(<p>{fieldName}: <strong>{dx}</strong></p>);
formattedDiagnosis.push(<p key={index}>{fieldName}: <strong>{dx}</strong></p>);
});
let sourceFields = [];
record.sourceField.split(',').map((field) => {
sourceFields.push(<p>{field}</p>);
record.sourceField.split(',').map((field, index) => {
sourceFields.push(<p key={index}>{field}</p>);
});
const confirmed = record.Confirmed === 'Y' ?
<p style={{color: 'green', fontSize: '3rem', textAlign: 'center'}}>
Expand Down

0 comments on commit e3b0cd2

Please # to comment.