Skip to content

Commit 8966900

Browse files
subhoghoshXmartinpitt
authored andcommitted
networking: don't pass null to input elements
changing the `value` attribute of React input elements to null changes it from controlled to uncontrolled, which leads to React logging errors in the browser console. This fixes errors of the form: Warning: A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen...
1 parent ff5be4c commit 8966900

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/networkmanager/ip-settings.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export const IpSettingsDialog = ({ topic, connection, dev, settings }) => {
128128
return false;
129129
};
130130
const addressIpv4Helper = (address) => {
131-
const config = { address, netmask: null, gateway: null };
131+
const config = { address, netmask: '', gateway: '' };
132132
const split = address.split('.');
133133

134134
if (split.length !== 4)
@@ -141,7 +141,7 @@ export const IpSettingsDialog = ({ topic, connection, dev, settings }) => {
141141
return { ...config, netmask: "255.255.0.0" };
142142
} else if (split[0] <= 192 && split[0] <= 223) {
143143
return { ...config, netmask: "255.255.255.0" };
144-
} else return { ...config, gateway: null };
144+
} else return { ...config, gateway: '' };
145145
};
146146

147147
return (

0 commit comments

Comments
 (0)