Skip to content

Commit

Permalink
chore(deps-dev): bump @types/react from 18.0.28 to 18.2.21 (#3674)
Browse files Browse the repository at this point in the history
* chore(deps-dev): bump @types/react from 18.0.28 to 18.2.21

Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 18.0.28 to 18.2.21.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

---
updated-dependencies:
- dependency-name: "@types/react"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore: keep react 18 versions in sync with package.json

* refactor(Dialog): narrow types inherited from ButtonProps for DialogButtonProps

* refactor(MarkdownViewer): use toString() on TrustedHTML type

* Update MarkdownViewer.tsx

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Josh Black <joshblack@users.noreply.github.com>
Co-authored-by: Josh Black <joshblack@github.com>
  • Loading branch information
3 people authored Sep 5, 2023
1 parent a2aca70 commit 01fa457
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 13 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
"@types/lodash.isobject": "3.0.7",
"@types/lodash.keyby": "4.6.7",
"@types/node": "18.16.19",
"@types/react": "18.0.28",
"@types/react": "18.2.21",
"@types/react-dom": "18.2.6",
"@typescript-eslint/eslint-plugin": "5.59.6",
"@typescript-eslint/parser": "5.62.0",
Expand Down
22 changes: 16 additions & 6 deletions script/set-react-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const fs = require('node:fs/promises')
const os = require('node:os')
const path = require('node:path')
const packageJson = require('../package.json')

const versions = new Map([
[
Expand Down Expand Up @@ -38,27 +39,27 @@ const versions = new Map([
devDependencies: [
{
name: '@types/react',
version: '18.0.28',
version: getPackageVersion('@types/react'),
},
{
name: '@types/react-dom',
version: '18.2.6',
version: getPackageVersion('@types/react-dom'),
},
{
name: 'react',
version: '18.2.0',
version: getPackageVersion('react'),
},
{
name: 'react-dom',
version: '18.2.0',
version: getPackageVersion('react-dom'),
},
{
name: 'react-test-renderer',
version: '18.2.0',
version: getPackageVersion('react-test-renderer'),
},
{
name: '@testing-library/react',
version: '14.0.0',
version: getPackageVersion('@testing-library/react'),
},
],
},
Expand All @@ -82,6 +83,15 @@ async function main(version = 17) {
await fs.writeFile(packageJsonPath, contents)
}

function getPackageVersion(name) {
const {devDependencies} = packageJson
if (devDependencies[name]) {
return devDependencies[name]
}

throw new Error(`Unable to find version for package: ${name}`)
}

const [version] = process.argv.slice(2)

// eslint-disable-next-line github/no-then
Expand Down
2 changes: 1 addition & 1 deletion src/Dialog/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const ANIMATION_DURATION = '200ms'
* Props that characterize a button to be rendered into the footer of
* a Dialog.
*/
export type DialogButtonProps = ButtonProps & {
export type DialogButtonProps = Omit<ButtonProps, 'content'> & {
/**
* The type of Button element to use
*/
Expand Down
2 changes: 1 addition & 1 deletion src/drafts/MarkdownViewer/MarkdownViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const MarkdownViewer = ({
await externalOnChange?.(value)
} catch (error) {
if (htmlContainer) {
htmlContainer.innerHTML = dangerousRenderedHTML.__html
htmlContainer.innerHTML = dangerousRenderedHTML.__html as string
}
}
},
Expand Down

0 comments on commit 01fa457

Please sign in to comment.