Open robbertrosario opened 1 year ago
I still haven't been able to resolve this, here is an example of what I mean:
const [token, saveToken] = useState<string | null>(null);
const provideEmbeddedHeaders = (uri: string, tagName: string) => {
if (tagName === 'img') {
return {
Authorization: `Bearer ${token}`,
};
}
};
The token state is fetched upon component render (useEffect) but provideEmbeddedHeaders has been rendered before this and does not rerender on state change. Seems like a pretty common use case to me, but the docs only show an example with a hardcoded authorization header: https://meliorence.github.io/react-native-render-html/api/renderhtmlconfig#provideembeddedheaders
Which I think is not the case most of the time, help would be appreciated.
Image not rendering its showing only a Box
However image link is accessible if i paste in browser addressbar
const renderersProps = {
img: {
enableExperimentalPercentWidth: true,
initialDimensions:{
height: 500,
width: 500
}
}
};
<RenderHtml
source={htmltorender}
contentWidth={500}
tagsStyles={tagsStyles}
classesStyles={classesStyles}
renderersProps={renderersProps}
/>
any update here ?
@jsamr
Decision Table
<yyy>
is not rendered”Good Faith Declaration
Description
I am working on a app where the images are behind authentication, using provideEmbeddedHeaders I am able to insert a bearer token and partly have this working on iOS however on Android no images are showing up first time around, when I come back to the screen with the images then they are there. I have been stuck on this for the past 2 days.
Is this a known issue? I've searched for the answer but couldn't find it.
My application is also facing the same bug as pointed out in this issue: https://github.com/meliorence/react-native-render-html/issues/580 it keeps rerendering when the images fail to load.
React Native Information
RNRH Version
6.3.3
Tested Platforms
Reproduction Platforms
Minimal, Reproducible Example
Additional Notes
No response