create-application-template 2.2.0 → 2.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-application-template",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
4
4
  "description": "provides a configured application template for you to build upon",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -7,7 +7,7 @@ const sitemapPath = path.resolve(__dirname, '../src/public/sitemap.xml')
7
7
  const baseUrl = packageJson.url || 'https://www.createapplicationtemplate.com/'
8
8
 
9
9
  if (existsSync(sitemapPath)) {
10
- console.log('📝 overwriting existing sitemap.xml')
10
+ console.info('📝 overwriting existing sitemap.xml')
11
11
  }
12
12
 
13
13
  const sitemap = `<?xml version="1.0" encoding="UTF-8"?>
@@ -23,7 +23,16 @@ export const Typewriter: FC<
23
23
  const [displayedText, setDisplayedText] = useState('')
24
24
  const [currentIndex, setCurrentIndex] = useState(0)
25
25
 
26
- useEffect(() => {
26
+ // NOTE: supports hot reload behavior in development:
27
+ // A) when the `text` prop changes (e.g. via hot reload), reset internal state
28
+ // B) this triggers the typing animation effect to restart with the new text
29
+
30
+ useEffect(() => { // A
31
+ setDisplayedText('')
32
+ setCurrentIndex(0)
33
+ }, [text])
34
+
35
+ useEffect(() => { // B
27
36
  const mySpeed = (currentIndex === 0) ? delay + speed : speed
28
37
 
29
38
  if (currentIndex < text.length) {