-
Notifications
You must be signed in to change notification settings - Fork 596
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
fix: 🐛 jsx syntax used in js file #152
base: master
Are you sure you want to change the base?
fix: 🐛 jsx syntax used in js file #152
Conversation
return createElement("div", { | ||
style: { | ||
width, | ||
height, | ||
}, | ||
ref, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use createElement function to create <div>
element.
width: PropTypes.string, | ||
name: PropTypes.string, | ||
loading: PropTypes.element, | ||
url: PropTypes.string, | ||
alive: PropTypes.bool, | ||
fetch: PropTypes.func, | ||
props: PropTypes.object, | ||
attrs: PropTypes.object, | ||
replace: PropTypes.func, | ||
sync: PropTypes.bool, | ||
prefix: PropTypes.object, | ||
fiber: PropTypes.bool, | ||
degrade: PropTypes.bool, | ||
plugins: PropTypes.array, | ||
beforeLoad: PropTypes.func, | ||
beforeMount: PropTypes.func, | ||
afterMount: PropTypes.func, | ||
beforeUnmount: PropTypes.func, | ||
afterUnmount: PropTypes.func, | ||
activated: PropTypes.func, | ||
deactivated: PropTypes.func, | ||
loadError: PropTypes.func, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change indentation from 4 spaces to 2 spaces.
import React from "react"; | ||
import React, { createElement } from "react"; | ||
import PropTypes from "prop-types"; | ||
import { bus, setupApp ,preloadApp, startApp, destroyApp } from "wujie"; | ||
import { bus, preloadApp, startApp, destroyApp, setupApp } from "wujie"; | ||
|
||
export default class WujieReact extends React.PureComponent { | ||
static propTypes = { | ||
height: PropTypes.string, | ||
width: PropTypes.string, | ||
name: PropTypes.string, | ||
loading: PropTypes.element; | ||
url: PropTypes.string, | ||
alive: PropTypes.bool, | ||
fetch: PropTypes.func, | ||
props: PropTypes.object, | ||
replace: PropTypes.func, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
align to packages/wujie-react/index.js
npm run test
通过详细描述
JSX syntax is used in a js file, change it from sugar to function calls.
From:
To: