ShaMan123 / react-native-math-view

Math view for react native! No WebView!
https://github.com/ShaMan123/react-native-math-view
MIT License
80 stars 25 forks source link

font size config not working for MathText #49

Open whitesnow9291 opened 3 years ago

whitesnow9291 commented 3 years ago

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?

ShaMan123 commented 3 years ago

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}} 
/>
Barklegne commented 3 years ago

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

Thanks

ShaMan123 commented 3 years ago

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

sickopickle commented 1 year ago

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

ShaMan123 commented 1 year ago

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

sickopickle commented 1 year ago

I just used mathview instead

khubaib-achieve commented 3 months ago

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

This PR should fix this issue.