This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Component = React.lazy(() => { | |
return import("./Component").then(({ default: Component }) => { | |
return { | |
default: React.forwardRef((props, ref) => ( | |
<Component ref={ref} {...props} /> | |
)) | |
}; | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable no-console */ | |
/** | |
* usage: | |
* `node scripts/areDocsConvertedToTSYet.js > converted.md` | |
* replace content of the <details /> (keep the <summary />) with | |
* `converted.md` | |
* | |
*/ | |
const fse = require('fs-extra'); | |
const glob = require('glob'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fse = require('fs-extra'); | |
const globCallback = require('glob'); | |
const { flatten } = require('lodash'); | |
const path = require('path'); | |
const childProcess = require('child_process'); | |
const { promisify } = require('util'); | |
const exec = promisify(childProcess.exec); | |
const glob = promisify(globCallback); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://astexplorer.net/#/gist/bc9e876927f9593ecbaa9d0fc115ac86/32ca9f448d2f4a02400b08a49922e7e6719d7d8b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare module 'material-ui-popup-state' { | |
import React from 'react'; | |
type Maybe<T> = T | null | undefined; | |
export type Variant = 'popover' | 'popper'; | |
export interface InjectedProps { | |
open: (eventOrAnchorEl: React.SyntheticEvent<unknown> | HTMLElement) => void; | |
close: () => void; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# -e Exit immediately if a command exits with a non-zero status. | |
set -e | |
circleci config validate | |
yarn prettier check-changed | |
yarn lint |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Press ctrl+space for code completion | |
module.exports = function transformer(file, api) { | |
const j = api.jscodeshift; | |
return j(file.source) | |
.find(j.CallExpression) | |
.filter(path => { | |
return path.get("callee").get("name").value === "warning"; | |
}) | |
.forEach(path => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
With #13229 we got the proper infrastructure to present our demos both in JavaScript and TypeScript. We want to continue this effort with the goal to have all demos available in TypeScript. | |
If you want to make contributions to this repository and know a bit of TypeScript we would appreciate you helping us. | |
## Getting started | |
TL;DR: Use #14739, #14485 or #14535 as example workflows. | |
0. Set up your fork (See ['getting started"](https://github.com/mui-org/material-ui/blob/next/CONTRIBUTING.md#getting-started) in the contributing guide). | |
1. Choose a demo you want to convert. For this example, we'll use: https://next.material-ui.com/demos/lists/#nested-list | |
2. go to `./docs/src/pages/demos/lists/lists.md` and find the section. You're looking for a `{{ "demo": "some-path" }}` block: |