You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I have successfully integrated other components into my electron app and it's working great, Thank you.
I think there is some issue with defaultChecked property of checkbox in Windows. Is it of type string ? as mentioned in docs
I checked the source, it checks if value and type is strictly boolean.
I'm totally new to react and electron development, if you could help me with issue it'd be great. Here is my full code: (Do read the comment below console.log(autostartBool);)
importReactfrom'react';importstyledfrom'styled-components';import{Checkbox}from'react-desktop/windows';// electron variablesconstsettings=require('electron-settings');constPREF_BOOT='boot';// PreferencesvarautostartBool=false;functioncheckIfPrefsAreInitialized(){if(!settings.has(PREF_BOOT)){settings.set(PREF_BOOT,autostartBool);}}classSettingsextendsReact.Component{constructor(props){super(props);// ====== PREF =============// At start (first time ever) if user will not have these prefs so ..// JUST SET IT !!checkIfPrefsAreInitialized();autostartBool=settings.get(PREF_BOOT);console.log(autostartBool);// For some reason it prints "I got checked!" // which is the defaultValue of Checkbox BUT the checkbox is not checked by default}render(){return(<Checkboxcolor={this.props.color}theme={this.props.theme}label="Automatically start Linkcue on boot"onChange={(e)=>{settings.set(PREF_BOOT,e.target.value)}}defaultValue="I got checked!"defaultChecked={autostartBool}/>);}}exportdefaultSettings;
The text was updated successfully, but these errors were encountered:
Hi, I have successfully integrated other components into my electron app and it's working great, Thank you.
I think there is some issue with defaultChecked property of checkbox in Windows. Is it of type string ? as mentioned in docs
I checked the source, it checks if value and type is strictly boolean.
I'm totally new to react and electron development, if you could help me with issue it'd be great. Here is my full code: (Do read the comment below console.log(autostartBool);)
The text was updated successfully, but these errors were encountered: