-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Typescript] 3 un-typed exports from @material-ui/core #19258
Comments
I don't think that any of the modules of diff --git a/packages/material-ui/src/styles/transitions.js b/packages/material-ui/src/styles/transitions.js
index 1cc6e1ad1..b4839a8a8 100644
--- a/packages/material-ui/src/styles/transitions.js
+++ b/packages/material-ui/src/styles/transitions.js
@@ -28,9 +28,9 @@ export const duration = {
leavingScreen: 195,
};
-export const formatMs = milliseconds => `${Math.round(milliseconds)}ms`;
-export const isString = value => typeof value === 'string';
-export const isNumber = value => !isNaN(parseFloat(value));
+function formatMs(milliseconds) {
+ return `${Math.round(milliseconds)}ms`;
+}
/**
* @param {string|Array} props
@@ -52,6 +52,9 @@ export default {
} = options;
if (process.env.NODE_ENV !== 'production') {
+ const isString = value => typeof value === 'string';
+ const isNumber = value => !isNaN(parseFloat(value));
+
if (!isString(props) && !Array.isArray(props)) {
console.error('Material-UI: argument "props" must be a string or Array.');
} I believe these methods were only exported recently with #18306. |
Regarding |
Awesome, I appreciate the speedy response. If that is the approach you'd like to take for |
For |
@JonKrone Do you want to take care of the modules in |
Sure thing - made the above PR :). There's probably a way to add this to the test suite. Could probably use the underlying typescript parser, ask it to generate a list of the symbols exported by the (Just as an aside, I've +1'd the Issue thread about transitioning |
Current Behavior 😯
@material-ui/core
exports 3 references that are not available in the typescript definitions:isString
,isNumber
, andstyleFunction
Expected Behavior 🤔
@material-ui/core
should either not export these variables or provide Typescript types for them.Steps to Reproduce 🕹
See the
testExports.ts
file and the console output in this demo: https://codesandbox.io/s/optimistic-wilbur-98lq2Context 🔦
We are trying to dynamically generate an
index.ts
file that re-exports all members of@material-ui/core
, except those which we have defined in our wrapping library. e.g., we want to customize the function of theTextField
elements, so want to override that element with our own export but just re-export most other Material components.While generating this file, we realized that not all of the actually-exported members of @material-ui/core had types for them.
Your Environment 🌎
The text was updated successfully, but these errors were encountered: