react-native-math-view icon indicating copy to clipboard operation
react-native-math-view copied to clipboard

font size config not working for MathText

Open whitesnow9291 opened this issue 4 years ago • 7 comments

config props works for MathView but not working for MathText

    <MathText
      value={props.math}
      config={{ ex: 50, em: 50 }}
      onError={e => console.log('ERROR!', e)}
      direction="ltr"
    />

This doesn't show big font. Screenshot at Jul 23 00-29-31

And where can I see all the props?

whitesnow9291 avatar Jul 22 '21 15:07 whitesnow9291

You are right. config isn't passed down: https://github.com/ShaMan123/react-native-math-view/blob/master/src/MathText.tsx#L45

You are welcome to PR.

You can instead handle this with the CellRenderComponent.


<MathText 
    CellRenderComponent={props => <MathView {...props} config={{...props.config, em: 50}} 
/>

ShaMan123 avatar Jul 23 '21 06:07 ShaMan123

The above solution still doesn't work can you please explain a bit?

Thanks

Barklegne avatar Aug 09 '21 15:08 Barklegne

Sorry, I don't have a lot of time left to maintain the repo. You are welcome to PR: Pass a config prop and merge it with inline prop This should work

https://github.com/ShaMan123/react-native-math-view/blob/master/src/MathText.tsx#L45

ShaMan123 avatar Aug 23 '21 09:08 ShaMan123

Can you explain what you mean by merging it with inline prop? Have you applied this already into the package?

sickopickle avatar Apr 17 '23 02:04 sickopickle

Don't remember Sorry Follow the code It should be a react fix, passing props

ShaMan123 avatar Apr 17 '23 10:04 ShaMan123

I just used mathview instead

sickopickle avatar Apr 17 '23 23:04 sickopickle

https://github.com/ShaMan123/react-native-math-view/pull/96

This PR should fix this issue.

khubaib-achieve avatar Aug 08 '24 19:08 khubaib-achieve