use antd components first import {xxx} from "antd"
is there any way to register components globally at the entrance so that you don"t have to import every time
use antd components first import {xxx} from "antd"
is there any way to register components globally at the entrance so that you don"t have to import every time
No.
antd is referenced on demand and componentized, assuming that all components can be injected at once. Do you think it's reasonable?
must not be reasonable, is it?
this. It should not be possible.
I haven't heard of it, but if the page doesn't need it, there's no need to quote it. It's better to quote it on demand.
for those who answer, I suggest you learn vue, and so on, you will know what its on-demand import means when you learn vue. React really has no way to import on demand in one place, without the need to import each time. There is also no way for the global component of react to achieve global injection, which does not need to be imported from every page. It can only be said that this is the limitation of react, or that vue has done a lot of work for us to make our code more concise. In the simplest case, react has to import every component once react, which is very redundant. I don't want to complain, but I just want to say that react developers and designers can't think about things from the user's point of view.
Previous: Can you use javascript to write a sticky drag-and-drop effect similar to that of qq unread messages?
how does it mean that return {} is an object, and then a comma separates two? Don t understand the meaning of the book ...
react project created based on creat-react-app,. In order to solve the compatibility of IE with some methods of Es6, babel-polyfill is introduced into the project. Can run normally in the local development environment, performing packaging upload to th...
I think one-way data flow and two-way data binding for the form do not conflict. If you encounter a complex form, if you do not use a third-party library, you can only use state plus event monitoring processing, which is a bit troublesome. ...
We have a project that was originally developed in react-native. Now we want to move this project to the h5 version of the web page. We use the react-naitve-web library. the process of building a project is to first create app, with react-create-app s...
use the form component of antd, the form element limit is required, and the form has the function of uploading attachments. I call an interface with ajax and assemble data including attachments with FormData. At this time, you need to set the parameter ...
problem description in componentDidMount, document.getElementById ( id ) is null the environmental background of the problems and what methods you have tried I try to use ref, to find undefined. in this.refs related codes componentDidMount() ...
during the interview, I encountered the following questions is tested correctly in the test environment, and a blank page appears in the formal environment. Because it is packaged in a framework, the code is compressed and breakpoints cannot be used ...
come straight to the point first import components App : nothing but layouts (components of antd), then I add three Link for click testing, a custom DDD component BBB< Link> < h3> <DDD> 1111111...
problem description restful development mode, however, when the front end gets the data sent from the server, many of them do not give default values, and many of them are caused by null, such as the string .toString (), length, and so on. if each fi...
run Can only set one of children or props.dangerouslySetInnerHTML after pulling the branch. there is no content in using dangerouslySetInnerHTML after global search. Solve ...
during the interview, you will ask how to structure your front-end project my answer is first of all, I will say that the technologies I use are react family bucket webpack and es6 then I will say that I will put each page in a separate folder e...
if you want to assign a variable, you can only require let shapeBack = require( . public img shapeBack.png ); then introduce into the source in the Image component but before, when we wrote react to import pictures, we used import,rn but not impor...
the following figure shows the content that appears when searching my personal website. Why is there only a loading? I have already set up keywords and description, why it doesn t work? my website is made of react and has been deployed for onl...
some repeated lists with some changes show whether it is feasible for simple interactive operation pages to be generated by dragging and dropping, and whether there is a running system to share ideas. ...