In my react native application I need to add + and - buttons in settings screen to increase or decrease the font size in the entire app when we click on those buttons from settings screen.Any help would be appreciated.
one way to make this is to create a state and update the fontsize on style
example:
const [fontSize, setFontSize] = useState(14);
return (
<p style={{fontSize: `${fontSize}px`}}>
My text
</p>
<button onChange={() => setFontSize(fontSize + 1)}>More</button>
<button onChange={() => setFontSize(fontSize - 1)}>Less</button>
);
to make this you can set this fontSize at top level.
another way to make this is add any CSS lib and set the same state in a global CSS using the * on css