Skip to content

Commit

Permalink
hot-loader: fix react-hot-patch not detect
Browse files Browse the repository at this point in the history
  • Loading branch information
zlatanpham committed May 4, 2019
1 parent ab4d7ea commit a2541a9
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
5 changes: 4 additions & 1 deletion config-overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@ const path = require('path')
module.exports = override(
addBabelPlugin('react-hot-loader/babel'),
addPostcssPlugins([tailwindcss('./tailwind.js')]),
addWebpackAlias({ '@': path.resolve(__dirname, 'src') })
addWebpackAlias({
'@': path.resolve(__dirname, 'src'),
'react-dom': '@hot-loader/react-dom',
})
)
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"repository": "https://github.com/zlatanpham/create-react-rewired-typescript-boilerplate",
"private": true,
"dependencies": {
"@hot-loader/react-dom": "^16.8.6",
"@types/jest": "24.0.11",
"@types/node": "11.13.4",
"@types/react": "16.8.16",
Expand Down
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { hot } from 'react-hot-loader/root'
import React, { Component } from 'react'
import React from 'react'
import './App.css'
import Button from '@/components/Button'
import { ThemeProvider, createGlobalStyle } from 'styled-components'
Expand Down
2 changes: 2 additions & 0 deletions src/components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import styled from 'styled-components'
const StyledButton = styled.button`
background-color: ${props => props.theme.colors.main};
border-radius: ${props => props.theme.borderRadius};
padding: 8px 20px;
font-weight: 600;
`

const Button = () => <StyledButton>My awesome button</StyledButton>
Expand Down
10 changes: 10 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,16 @@
dependencies:
"@hapi/hoek" "6.x.x"

"@hot-loader/react-dom@^16.8.6":
version "16.8.6"
resolved "https://registry.yarnpkg.com/@hot-loader/react-dom/-/react-dom-16.8.6.tgz#7923ba27db1563a7cc48d4e0b2879a140df461ea"
integrity sha512-+JHIYh33FVglJYZAUtRjfT5qZoT2mueJGNzU5weS2CVw26BgbxGKSujlJhO85BaRbg8sqNWyW1hYBILgK3ZCgA==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
prop-types "^15.6.2"
scheduler "^0.13.6"

"@jest/console@^24.7.1":
version "24.7.1"
resolved "https://registry.yarnpkg.com/@jest/console/-/console-24.7.1.tgz#32a9e42535a97aedfe037e725bd67e954b459545"
Expand Down

0 comments on commit a2541a9

Please sign in to comment.