Skip to content

Commit

Permalink
feat: react 18 support & strict mode (#321)
Browse files Browse the repository at this point in the history
* chore: fix dts test

* chore: update react packages

* chore: update tests

* chore: fix dummy

* fix: working inside React.StrictMode

* chore: fix tests

* chore: revert dummy example
  • Loading branch information
nd0ut authored May 11, 2022
1 parent e6d78b5 commit a4d643d
Show file tree
Hide file tree
Showing 11 changed files with 12,670 additions and 17,077 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,7 @@ en
en-min
e2e_test
locales.js

# parcel cache
.parcel-cache
.parcel-output
5 changes: 5 additions & 0 deletions .parcelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": ["@parcel/config-default"],
"distDir": "./parcel-output",
"outputFormat": "esmodule"
}
12 changes: 8 additions & 4 deletions dummy/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import ReactDOM from 'react-dom'
import { createRoot } from 'react-dom/client'

import DynamicLocales from './dynamic-locales'
import Callbacks from './dialog-callbacks'
Expand Down Expand Up @@ -43,7 +43,11 @@ const examples = [
}
]

ReactDOM.render(
examples.map((props, key) => <Example key={key} {...props} />),
document.getElementById('root')
const root = createRoot(document.getElementById('root'))
root.render(
<React.StrictMode>
{examples.map((props, key) => (
<Example key={key} {...props} />
))}
</React.StrictMode>
)
2 changes: 1 addition & 1 deletion dummy/dialog-callbacks.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'

import { Widget } from '..'
import { Widget } from '../src/index.js'

export default () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion dummy/dynamic-locales.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useReducer } from 'react'
import { Widget } from '..'
import { Widget } from '../src/index.js'

const translation = (text) => ({
dialog: {
Expand Down
Loading

0 comments on commit a4d643d

Please sign in to comment.