当有人单击时如何更改按钮文本?
代码:
<Button disabled={this.state.disabled}
type="primary"
htmlType="submit"
style={{
background: '#ff9700',
fontWeight: 'bold',
border: 'none',
float: 'center',
}}
loading={this.state.loading}
onClick={this.enterLoading}
value="Next"
id="buttontext"
onClick="changeText()"
>
Next
</Button>
Run Code Online (Sandbox Code Playgroud) I am working on project in ReactJS, Currently I am using ant-design for file uploading. I want to preview video when user select a video . I am new to reactjs and unable to complete my task. Could someone please help me how it would be possible to preview a video . I will share my code with you You may check my code . Thanks
Code
import React from 'react';
import styled from 'styled-components';
import 'antd/dist/antd.css';
import './styletwo.css';
import …Run Code Online (Sandbox Code Playgroud) 我知道状态允许我们创建动态和交互的组件,但我想深入了解状态.
有人可以帮助我使用现实生活中的例子了解React中的状态吗?
我是 ReactJS 的初学者,目前我正在使用styled-component一些模块的样式。实际上我在一个文件夹中创建了 2 个文件。一个是style.js我正在制作 2,3 对象,现在我想将这 3 个对象导出到我的另一个文件,该文件的名称是2nd.js但它对我不起作用你能帮我吗我如何将style.js对象导入到我的文件中。
Style.js 代码
import styled from 'styled-components';
export const SubText = styled.div`
font-size: 20px;
text-align: center;
padding-bottom: 30px;
width: 330px;
color: #012653;
margin: 0 auto;
font-weight: 440;
`;
export const GeneralText = styled.div`
color: red;
font-size: 26px;
font-weight: 600;
text-align: center;
min-width: 266px;
padding-bottom: 30px;
font-family: Lato, sans-serif;
margin-top: 50px;
color: #012653;
`;
export const ButtonWrapper = styled.div`
text-align: center;
margin-top: 26px;
`;
Run Code Online (Sandbox Code Playgroud)
第二个.js代码 …