<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>React ref 手動 focus 彙整 - JS Ying&#039;s Blog</title>
	<atom:link href="https://blog.jsy.tw/tag/react-ref-%E6%89%8B%E5%8B%95-focus/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description></description>
	<lastBuildDate>Thu, 19 Jun 2025 02:45:39 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.5</generator>

<image>
	<url>https://blog.jsy.tw/wp-content/uploads/2022/03/cropped-logo-32x32.png</url>
	<title>React ref 手動 focus 彙整 - JS Ying&#039;s Blog</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">188181961</site>	<item>
		<title>【筆記】React Input 輸入框 autoFocus 無法生效</title>
		<link>https://blog.jsy.tw/2806/react-input-autofocus-not-working/</link>
					<comments>https://blog.jsy.tw/2806/react-input-autofocus-not-working/#comments</comments>
		
		<dc:creator><![CDATA[JS Ying]]></dc:creator>
		<pubDate>Wed, 18 Jun 2025 10:21:06 +0000</pubDate>
				<category><![CDATA[前端]]></category>
		<category><![CDATA[程式相關]]></category>
		<category><![CDATA[React autoFocus not working]]></category>
		<category><![CDATA[React autoFocus 無效]]></category>
		<category><![CDATA[React ref 手動 focus]]></category>
		<category><![CDATA[useEffect window.innerWidth]]></category>
		<guid isPermaLink="false">https://blog.jsy.tw/?p=2806</guid>

					<description><![CDATA[<p>最近遇到一個有趣的小問題，簡單地筆記一下：React 用變數判斷是否啟用 autuFocus，有時會失效？原來是跟 DOM 的行為有關。本文將提供三種解法——條件渲染、初始寬度判斷以及 ref 手動 foucs。</p>
<p>這篇文章 <a href="https://blog.jsy.tw/2806/react-input-autofocus-not-working/">【筆記】React Input 輸入框 autoFocus 無法生效</a> 最早出現於 <a href="https://blog.jsy.tw">JS Ying&#039;s Blog</a>。</p>
]]></description>
		
					<wfw:commentRss>https://blog.jsy.tw/2806/react-input-autofocus-not-working/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2806</post-id>	</item>
	</channel>
</rss>
