Skip to content
This repository has been archived by the owner on Nov 22, 2024. It is now read-only.

Commit

Permalink
Fix issue when state value is null
Browse files Browse the repository at this point in the history
Summary:
Got a string issue where data from the client was

[null]

This was blowing up in this method when we were calling Object.enties(null)

Reviewed By: antonk52

Differential Revision: D65535726

fbshipit-source-id: 9939608e3bc7e218c668cfc425b423ba0d9aee06
  • Loading branch information
Luke De Feo authored and facebook-github-bot committed Nov 6, 2024
1 parent b0deca5 commit b070d3f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion desktop/plugins/public/ui-debugger/ClientTypes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -362,5 +362,5 @@ export type InspectableArray = {

export type InspectableUnknown = {
type: 'unknown';
value: string;
value: string | null;
};
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ export function StyledTextArea({
style,
}: {
style?: React.CSSProperties;
value: string;
value: string | null;
color: string;
mutable: boolean;
onChange: (value: string) => void;
onChange: (value: string | null) => void;
rightAddon?: string;
}) {
const optimisticValue = useOptimisticValue(value, onChange);
Expand All @@ -36,7 +36,7 @@ export function StyledTextArea({
bordered
style={{color, ...pendingStyle(optimisticValue), ...style}}
readOnly={!mutable}
value={optimisticValue.value}
value={optimisticValue.value ?? undefined}
onChange={(event) => optimisticValue.onChange(event.target.value)}
/>
);
Expand Down

0 comments on commit b070d3f

Please sign in to comment.