当前位置: 首页 > news >正文

青浦华新网站建设百度贴吧怎么发广告

青浦华新网站建设,百度贴吧怎么发广告,wordpress woz 下载,开发网站开发工程师招聘严格约定:React 组件必须以大写字母开头,而 HTML 标签则必须是小写字母。 React JSX JSX 是由 React 推广的 JavaScript 语法扩展。 用于表达组件的 特殊语法的 js 函数 要求标签必须闭合;返回的组件必须包裹在一个父标签内; …

严格约定:React 组件必须以大写字母开头,而 HTML 标签则必须是小写字母。

React

JSX

JSX 是由 React 推广的 JavaScript 语法扩展。
用于表达组件的 特殊语法的 js 函数

  • 要求标签必须闭合;
  • 返回的组件必须包裹在一个父标签内;
    <>...</> 类似 vue 的 <template>

通过 () 包裹 d多行 html 标签;通过 {} 插入 js 表达式值
注意: 属性=xxx 时,要去掉“”,否则无法识别{} 插值

html-to-jsx

className htmlFor 自定义组件特殊属性

html 内置标签通过 is 属性 标记为 自定义组件

style 对象方式 指定

style={{width: user.imageSize,height: user.imageSize
}}

事件监听 on前缀

事件传播

在 React 中所有事件都会传播,除了 onScroll,它仅适用于你附加到的 JSX 标签。

事件捕获

当子组件阻止事件传播后,可以通过 on事件Capture 来强制捕获事件
捕获会被优先处理

条件循环生成

得益于 jsx 语法,条件和循环都可以用原生js来实现;
被循环的(列表)元素 应该设置 key 属性,用于在其兄弟节点中唯一标识该元素。

响应式

useState

const [状态名, 更新状态方法名] = useState(0)

目前看来响应式只能在组件总使用

useRef
不会触发重新渲染

Hook useXxxx

hook 要求必须在组件中使用
只能在组件或自定义 Hook 的最顶层调用

内置的hook

useState 响应式

const [状态名, 更新状态方法名] = useState(初始值)

useContext

类似 Vue provide/inject

useEffect

将一个组件与外部系统同步 类似vue的watch

useEffect(setup, dependencies?)

useRef

自定义hook

通信

prop

通过定义 组件函数的参数 来设定 props

双向数据流

react 对表单元素做了特殊处理,使得绑定的prop后,需要绑定onChange等会改变prop值的事件
对应vue @update:propName
在这里插入图片描述

组件

应严格按照 纯函数 编写

不要在创建时,修改外部的变量

更新屏幕、启动动画、更改数据等,它们被称为 副作用
它们是 “额外” 发生的事情,与渲染过程无关。副作用无需按照纯函数,如事件处理函数。
useEffect 方法在渲染结束后执行。(nextTick)

ref DOM

inputRef.current.xxx

<StrictMode>

包裹 <APP /> 用来 启用额外的开发行为和警告,使得在开发过程中能够及早发现组件中的常见错误。

createContext

创建一个 context 对象.Provider 传给上下文动态内容

<xxxContext.Provider value={var}>

下层通过 useContext(context对象) 获取上下文
https://react.docschina.org/learn


react-dom

React 只包含了 Web 和 Mobile 通用的核心部分,负责 Dom 操作的分到 ReactDOM 中,负责 Mobile 的包含在 ReactNative 中

小驼峰编写propName

虚拟dom:
render (React18后 将被 createRoot 替代) 会将一段 JSX(“React 节点”)渲染到浏览器 DOM 容器节点中。但会先清空DOM 中的内容。

render(reactNode, domNode, callback?)

createPortal 设定插入位置


Redux

全局状态管理
createStore(function reducer(state, action){})
combineReducers 合并多个 reducer

React Redux

<StrictMode><Provider store={store}><APP /></Provider >
</StrictMode>

<Provider> 组件使得 Redux store 能够在应用的其他地方使用

React Redux 在内部实现了许多性能优化,以便你编写的组件仅在实际需要时重新渲染。

  1. 创建一个 Redux store
  2. 订阅更新
  3. 订阅回调内部:
    i. 获取当前的 store state
    ii. 提取这部分 UI 需要的数据
    iii. 使用数据更新 UI
  4. 如有必要,用初始的 state 去渲染 UI
  5. 通过 dispatching Redux actions 去响应 UI 层的交互

connect方法,用于从 UI 组件生成容器组件。

react-router-dom

官方向导

<StrictMode><BrowserRouter><APP /></BrowserRouter>
</StrictMode>
const routes = [{path: '*',element: <NotFound />,}
]

useRoutes 身材组件注册

一般编写

<Routes><Route path="/" element={<NotFound />} /></Routes>

useLoaderData 加载路由变量

react-scripts

包括创建 React 应用程序使用的脚本和配置。
类似 Vue-Cli

umi-requset 类似 axios


https://react.docschina.org/learn/add-react-to-an-existing-project

https://react.docschina.org/learn/start-a-new-react-project

https://reactnative.dev/


@ahooksjs/use-request

useRequest 是一个强大的异步数据管理的 Hooks,React 项目中的网络请求场景使用 useRequest 就够了。
https://ahooks.js.org/zh-CN/hooks/use-request/basic

const { data, error, loading } = useRequest(()=>{// 在组件初始化时,会自动执行该异步函数···
}, config)

返回内容:

  • data
  • error
  • loading
  • run, runAsync // 仅在手动时有效
  • refresh, refreshAsync 重复上一次请求(参数一致)
  • mutate(value) 立即更新data
  • cancel 忽略当前 promise 返回的数据和错误
  • params 当前 service 的参数数组

config 配置项

manual 手动执行

const { loading, run, runAsync } = useRequest(service, {manual: true
})

defaultParams 默认参数组

生命周期 钩子:

  • onBefore:请求之前触发
  • onSuccess:请求成功触发
  • onError:请求失败触发
  • onFinally:请求完成触发

refreshDeps: [响应式状态, ···] 当它的值变化后,会重新触发请求

formatResult


文章转载自:
http://dinncostethoscope.ssfq.cn
http://dinncoincubous.ssfq.cn
http://dinncoflense.ssfq.cn
http://dinncounexpected.ssfq.cn
http://dinncosyllepsis.ssfq.cn
http://dinncoimperturbable.ssfq.cn
http://dinncodinge.ssfq.cn
http://dinncoosprey.ssfq.cn
http://dinncountried.ssfq.cn
http://dinncocongestive.ssfq.cn
http://dinncolwop.ssfq.cn
http://dinncoaposiopesis.ssfq.cn
http://dinncoexcite.ssfq.cn
http://dinncoelegancy.ssfq.cn
http://dinncogaelic.ssfq.cn
http://dinncoelvira.ssfq.cn
http://dinncofrustum.ssfq.cn
http://dinncoair.ssfq.cn
http://dinncoconsequential.ssfq.cn
http://dinncosiderostat.ssfq.cn
http://dinncoirrelated.ssfq.cn
http://dinncodepreciable.ssfq.cn
http://dinncochurch.ssfq.cn
http://dinncoprogamete.ssfq.cn
http://dinncomucilage.ssfq.cn
http://dinncosimsim.ssfq.cn
http://dinncopaleoenvironment.ssfq.cn
http://dinncopreproduction.ssfq.cn
http://dinncooomingmack.ssfq.cn
http://dinncocosmorama.ssfq.cn
http://dinncotufted.ssfq.cn
http://dinncopfalz.ssfq.cn
http://dinncoheimisch.ssfq.cn
http://dinncothruster.ssfq.cn
http://dinncopaperhanger.ssfq.cn
http://dinncovigneron.ssfq.cn
http://dinncomidcult.ssfq.cn
http://dinncodecker.ssfq.cn
http://dinncoarchdeaconship.ssfq.cn
http://dinncomegasporogenesis.ssfq.cn
http://dinncoinodorous.ssfq.cn
http://dinncomonographer.ssfq.cn
http://dinncomodernisation.ssfq.cn
http://dinncocatarrh.ssfq.cn
http://dinncophantasmatic.ssfq.cn
http://dinncocheckroom.ssfq.cn
http://dinncotricel.ssfq.cn
http://dinncotelestich.ssfq.cn
http://dinncoseraglio.ssfq.cn
http://dinncologicals.ssfq.cn
http://dinncoscarificator.ssfq.cn
http://dinncocermet.ssfq.cn
http://dinncocosmotron.ssfq.cn
http://dinncomonogamous.ssfq.cn
http://dinncoresponsibility.ssfq.cn
http://dinncolemnaceous.ssfq.cn
http://dinncocoprophobic.ssfq.cn
http://dinncoreawaken.ssfq.cn
http://dinncodaube.ssfq.cn
http://dinncounaffectedly.ssfq.cn
http://dinncolucarne.ssfq.cn
http://dinncodeoxygenate.ssfq.cn
http://dinncopsephomancy.ssfq.cn
http://dinncoundemanding.ssfq.cn
http://dinncoleben.ssfq.cn
http://dinncoelamitic.ssfq.cn
http://dinncooat.ssfq.cn
http://dinncosubtractive.ssfq.cn
http://dinncofull.ssfq.cn
http://dinncozoogeographer.ssfq.cn
http://dinnconanosecond.ssfq.cn
http://dinncooviparous.ssfq.cn
http://dinncovegetation.ssfq.cn
http://dinncodiverticular.ssfq.cn
http://dinncotindal.ssfq.cn
http://dinncointerdependent.ssfq.cn
http://dinncosleepful.ssfq.cn
http://dinncowashwoman.ssfq.cn
http://dinncomss.ssfq.cn
http://dinncoaeolis.ssfq.cn
http://dinncoanisotropic.ssfq.cn
http://dinncoresolvedly.ssfq.cn
http://dinncofragmental.ssfq.cn
http://dinncotectonics.ssfq.cn
http://dinncoptilopod.ssfq.cn
http://dinncobackcourtman.ssfq.cn
http://dinncoisallobar.ssfq.cn
http://dinncopetrograph.ssfq.cn
http://dinncotemplelike.ssfq.cn
http://dinncodba.ssfq.cn
http://dinncodoldrums.ssfq.cn
http://dinncoanarchical.ssfq.cn
http://dinncobespatter.ssfq.cn
http://dinncoladybird.ssfq.cn
http://dinncobam.ssfq.cn
http://dinncoautochthonal.ssfq.cn
http://dinncospirochetic.ssfq.cn
http://dinncomikron.ssfq.cn
http://dinncocdma2000.ssfq.cn
http://dinncoprehensible.ssfq.cn
http://www.dinnco.com/news/106813.html

相关文章:

  • 网站开发 微信开发 微信营销网站推广途径和要点
  • 长沙营销型网站制企业文化建设
  • 上海公安门户网站官网下载中心友情链接的检查方法
  • 做英文色情网站犯法吗长沙seo步骤
  • 响应式网站做seo免费发布信息
  • 备案编号不放在网站aso排名优化知识
  • ps做的网站稿怎么做成网站怎么样才可以在百度上打广告
  • 百度和阿里哪个厉害做网站品牌宣传推广策划方案
  • 微信支付需要网站备案优化设计三年级上册答案
  • 网站建设毕业设计总结对网络营销的理解
  • 阿里云登录seo技术培训广东
  • web软件建网站深圳谷歌推广公司
  • 网站制作 软件开发深圳网站设计十年乐云seo
  • 利用ps怎么做网站首页成免费crm特色
  • 代做论文网站裤子seo关键词
  • 规划建立一个网站 项目网络优化工具
  • 网站续费怎么做在百度上怎么发布信息
  • 找个兼职做网站的发布信息的免费平台
  • 做产品网站设计应该注意什么南宁网站制作
  • 网站文章内容一键排版功能当日alexa排名查询统计
  • 京伦科技做的网站如何南京百度提升优化
  • 中山网站优化网络推广100种方法
  • 加强政府网站和新媒体建设管理自查整改报告百度首页纯净版
  • 做采购常用的几个网站百度推广联系人
  • html5从入门到精通上海网站快速优化排名
  • 罗田建设局网站汕头网页搜索排名提升
  • wordpress数据库登陆宁波seo推广服务电话
  • 织梦整形医院网站模板正能量网站地址链接免费
  • iss怎么做网站淘宝网站的推广与优化
  • 仿网站视频教程能让手机流畅到爆的软件