Skip to content

Can I change font after init? #419

@eliezra236

Description

@eliezra236

Hi,

I am trying to allow my users to change the font.

            <Button
                title="Change Font"
                onPress={() => {
                    setChangeFont((prevValue) => !prevValue);
                }}
            />
            <RichEditor
                ref={richTextRef}
                editorStyle={changeFont ? initialCSSText : undefined}
                style={{
                    minHeight: 200,
                    backgroundColor: '#f0f0f0',
                    borderWidth: 2,
                    borderColor: 'red',
                }}
                editorInitializedCallback={() =>
                    console.log('Editor initialized')
                }
                onChange={(text) => setText(text)}
                placeholder="Rich Editor Here"
            />

But it won't work, clicking the button and changing the state won't affect the rich editor.
Is there any other way to allow font change?
There's an action called fontName but I couldn't find a way to use it, and it's not in the docs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions