Static content in <Raw/> disappears after component refresh
See original GitHub issueUsing crank v0.4.0 🎉
I have a component that renders some markdown using <Raw/> and noticed that after refreshing the component the markdown would disappear.
For example, the static content in the second <Raw/> tag will disappear after clicking the button to refresh. However, the dynamic content in the first one will still render correctly.
function* App() {
let refreshCount = 0;
const refresh = () => {
refreshCount += 1;
this.refresh();
};
for (const {} of this) {
yield (
<Fragment>
<div>
<Raw value={`<h1>Dynamic content ${refreshCount}</h1>`} />
<Raw value="<h2>Static <em>raw</em> content</h2>" />
</div>
<button type="button" onclick={refresh}>
Refresh
</button>
</Fragment>
);
}
}
Codesandbox example: https://codesandbox.io/s/raw-tag-content-disappearing-unngm
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9 (9 by maintainers)
Top Results From Across the Web
React component content disappears after page refresh
I am new to react and am having trouble figuring out why the data inside my Content component does not re-render on refresh....
Read more >Fast refresh not working properly due to page reload ... - GitHub
Hi, I have the same issue. To reproduce it: import a function in react component then the same function import in your _middleware.js....
Read more >Basic Features: Fast Refresh - Next.js
Next.js' Fast Refresh is a new hot reloading experience that gives you instantaneous feedback on edits made to your React components.
Read more >Server-side rendering - Apollo GraphQL Docs
Server-side rendering (SSR) is a performance optimization for modern web apps. It enables you to render your app's initial state to raw HTML...
Read more >Handling common JavaScript problems - MDN Web Docs
Now we'll look at common cross-browser JavaScript problems and how to fix them. This includes information on using browser dev tools to track ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I created PR #224 with a change to
updateRaw. If you want I can look into changing whatrenderer.parse()returns, just let me know.@brainkim In
updateRawI can see how refreshing the component skips over the conditional and returnsret.value:What I’m not sure about is where the fix should go. Does
updateRawneed to be changed or is it just being passed a bad value (i.e.ret.valueis incorrect)?