Skip to content

Commit

Permalink
skip parent is section check; coz why not detail be present outside s…
Browse files Browse the repository at this point in the history
…ection too
  • Loading branch information
rithviknishad committed Sep 13, 2024
1 parent cb23669 commit 20cb8ee
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/Components/LogUpdate/CriticalCarePreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -555,17 +555,13 @@ const Detail = (props: {
}) => {
const context = React.useContext(sectionContext);

if (context === null) {
throw "This component must be used as a descendant of Section component only";
}

let value = props.value;
value = value === "" ? null : value;
value = value === true ? "Yes" : value;
value = value === false ? "No" : value;

React.useEffect(() => {
if (value != null) {
if (context && value != null) {
context.hasValue();
}
}, [context, value]);
Expand Down

0 comments on commit 20cb8ee

Please sign in to comment.