<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: James Zhan</title>
    <description>The latest articles on Forem by James Zhan (@jzhan).</description>
    <link>https://forem.com/jzhan</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1092764%2Fcaa2a1da-6cab-400a-aa04-74d3cf90785b.jpeg</url>
      <title>Forem: James Zhan</title>
      <link>https://forem.com/jzhan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/jzhan"/>
    <language>en</language>
    <item>
      <title>How can I update a class component in SyncLane?</title>
      <dc:creator>James Zhan</dc:creator>
      <pubDate>Tue, 23 Apr 2024 05:25:47 +0000</pubDate>
      <link>https://forem.com/jzhan/how-can-i-update-a-class-component-in-synclane-13k2</link>
      <guid>https://forem.com/jzhan/how-can-i-update-a-class-component-in-synclane-13k2</guid>
      <description>&lt;p&gt;In react 18 concurrency, sometime we want to specify a higher priority for UI update triggered by external store.&lt;/p&gt;

&lt;p&gt;This can be done for function component by using &lt;code&gt;useSyncExternalStore&lt;/code&gt; that when the external store updates, react will update the UI in SyncLane.&lt;/p&gt;

&lt;p&gt;However, I can't find any information on how to make class component's &lt;code&gt;forceUpdate&lt;/code&gt; to be in SyncLane. &lt;/p&gt;

&lt;p&gt;In react experimental version, I can use &lt;code&gt;unstable_runWithPriority&lt;/code&gt; API to achieve the effect I want. Is there a more stable way to do it?&lt;/p&gt;

</description>
      <category>react</category>
    </item>
  </channel>
</rss>
