Fixes text widget not showing zero and false (#2877)

* fixed Text Widget not showing zero and false

* made the required changes
This commit is contained in:
Manish Kushare 2022-04-26 19:34:39 +05:30 committed by GitHub
parent efeef4d0db
commit 9eed9b1134
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,7 +5,9 @@ export const Text = function Text({ height, properties, styles, darkMode }) {
const [loadingState, setLoadingState] = useState(false);
const { textColor, textAlign, visibility, disabledState } = styles;
const text = properties.text ?? '';
const text = properties.text === 0 || properties.text === false ? properties.text?.toString() : properties.text;
const color = textColor === '#000' ? (darkMode ? '#fff' : '#000') : textColor;
useEffect(() => {