diff --git a/docs/README.md b/docs/README.md
index d4156afc9a..6207703326 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -17,7 +17,7 @@ Check the [styleguide](https://docs.cozy.io/cozy-ui/styleguide) to see all the v
## React components
-Check out [UI components](https://docs.cozy.io/cozy-ui/react/) to see how to use ready made (p)React components.
+Check out [UI components](https://docs.cozy.io/cozy-ui/react/) to see how to use ready made React components.
## Usage
@@ -38,7 +38,7 @@ import 'cozy-ui/transpiled/react/stylesheet.css'
```
-You're now ready to use [Cozy UI's (p)React components](https://docs.cozy.io/cozy-ui/react/)
+You're now ready to use [Cozy UI's React components](https://docs.cozy.io/cozy-ui/react/)
### Utility classes
diff --git a/package.json b/package.json
index c4313da9b7..a5db409a88 100644
--- a/package.json
+++ b/package.json
@@ -111,8 +111,6 @@
"npm-run-all": "4.1.5",
"postcss-cli": "6.1.3",
"postcss-loader": "2.1.6",
- "preact": "8.4.2",
- "preact-portal": "1.1.3",
"pretty": "2.0.0",
"prop-types": "15.7.2",
"puppeteer": "2.1.1",
@@ -160,8 +158,6 @@
"cozy-device-helper": "1.10.0",
"cozy-doctypes": "^1.69.0",
"piwik-react-router": "^0.8.2",
- "preact": "^8.3.1",
- "preact-portal": "^1.1.3",
"puppeteer": "1.20.0",
"react": "^16.8.6",
"react-dom": "^16.8.6"
diff --git a/react/AppTile/__snapshots__/AppTile.spec.jsx.snap b/react/AppTile/__snapshots__/AppTile.spec.jsx.snap
index fc38f602e0..45a7273189 100644
--- a/react/AppTile/__snapshots__/AppTile.spec.jsx.snap
+++ b/react/AppTile/__snapshots__/AppTile.spec.jsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`AppTile component should render correctly an app 1`] = `
-
-
+
`;
exports[`AppTile component should render correctly an app in maintenance 1`] = `
-
-
+
`;
exports[`AppTile component should render correctly an app with iconToLoad (icon being fetching) 1`] = `
-
-
+
`;
exports[`AppTile component should render correctly an app with iconToLoad if isMobile 1`] = `
-
-
+
`;
exports[`AppTile component should render correctly an app without developer property 1`] = `
-
-
+
`;
exports[`AppTile component should render correctly an installed app 1`] = `
-
-
+
`;
exports[`AppTile component should render correctly an installed app without icon provided 1`] = `
-
-
+
`;
diff --git a/react/I18n/index.jsx b/react/I18n/index.jsx
index ceb47017df..1009db0fd7 100644
--- a/react/I18n/index.jsx
+++ b/react/I18n/index.jsx
@@ -15,7 +15,7 @@ export const DEFAULT_LANG = 'en'
export const I18nContext = React.createContext()
// Provider root component
-class BaseI18n extends Component {
+export class I18n extends Component {
constructor(props) {
super(props)
this.init(this.props)
@@ -58,7 +58,7 @@ class BaseI18n extends Component {
}
}
-BaseI18n.propTypes = {
+I18n.propTypes = {
lang: PropTypes.string.isRequired, // current language.
polyglot: PropTypes.object, // A polyglot instance.
dictRequire: PropTypes.func, // A callback to load locales.
@@ -66,24 +66,16 @@ BaseI18n.propTypes = {
defaultLang: PropTypes.string // default language. By default is 'en'
}
-BaseI18n.defaultProps = {
+I18n.defaultProps = {
defaultLang: DEFAULT_LANG
}
-BaseI18n.childContextTypes = {
+I18n.childContextTypes = {
t: PropTypes.func,
f: PropTypes.func,
lang: PropTypes.string
}
-class PreactI18n extends BaseI18n {
- componentWillReceiveProps(nextProps) {
- this.UNSAFE_componentWillReceiveProps(nextProps)
- }
-}
-
-export const I18n = process.env.USE_PREACT ? PreactI18n : BaseI18n
-
// higher order decorator for components that need `t` and/or `f`
export const translate = () => WrappedComponent => {
const Wrapper = props => {
diff --git a/react/Portal/index.jsx b/react/Portal/index.jsx
index 17d59e6fef..b4122c043f 100644
--- a/react/Portal/index.jsx
+++ b/react/Portal/index.jsx
@@ -1,17 +1,8 @@
-let Portal
-if (process.env.USE_PREACT) {
- try {
- Portal = require('preact-portal')
- } catch (e) {
- // We need this try/catch for webpack not to error if preact-portal
- // is not found
- }
-} else {
- const ReactDOM = require('react-dom')
- Portal = ({ into, children }) => {
- const targetElement = document.querySelector(into)
- return ReactDOM.createPortal(children, targetElement)
- }
+import ReactDOM from 'react-dom'
+
+const Portal = ({ into, children }) => {
+ const targetElement = document.querySelector(into)
+ return ReactDOM.createPortal(children, targetElement)
}
export default Portal
diff --git a/react/Viewer/ViewerExposer.js b/react/Viewer/ViewerExposer.js
index 5b388bc71f..3f768646a3 100644
--- a/react/Viewer/ViewerExposer.js
+++ b/react/Viewer/ViewerExposer.js
@@ -1,8 +1,3 @@
-let defaultViewer
-if (process.env.USE_PREACT) {
- defaultViewer = ''
-} else {
- defaultViewer = require('./index').default
-}
+import DefaultViewer from './index'
-export default defaultViewer
+export default DefaultViewer
diff --git a/yarn.lock b/yarn.lock
index 53fcb49197..e1d13e421b 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -13757,16 +13757,6 @@ posthtml@^0.9.2:
posthtml-parser "^0.2.0"
posthtml-render "^1.0.5"
-preact-portal@1.1.3:
- version "1.1.3"
- resolved "https://registry.yarnpkg.com/preact-portal/-/preact-portal-1.1.3.tgz#22cdd3ecf6ad9aaa3f830607a9c6591de90aedb7"
- integrity sha512-rE0KG2b7ggIly4VVsSm7+WmQmG/EoUZzBOed2IbycyaFIArOvz+yab/8RBoDogA0JWZuTsbMTStR41Ghc+5m7Q==
-
-preact@8.4.2:
- version "8.4.2"
- resolved "https://registry.yarnpkg.com/preact/-/preact-8.4.2.tgz#1263b974a17d1ea80b66590e41ef786ced5d6a23"
- integrity sha512-TsINETWiisfB6RTk0wh3/mvxbGRvx+ljeBccZ4Z6MPFKgu/KFGyf2Bmw3Z/jlXhL5JlNKY6QAbA9PVyzIy9//A==
-
prelude-ls@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"