Commit Graph

9 Commits

Author SHA1 Message Date
水澜 41be75ff23
fix: rax compat state (#6166)
* fix: state not update error

* fix: forwardRef with defaultProps

* fix: get latest eagerState in useCallback

* fix: lint

* fix: lint

* chore: add changeset

* test: rax-compat useCallback

* fix: test

* fix: lint

---------

Co-authored-by: soar.gy <soar.gy@alibaba-inc.com>
2023-05-01 23:46:25 +08:00
ZeroLing 8cfdfd96c3
fix: useState parameter initialState can be function, which should be… (#6033)
* fix: useState parameter initialState can be function, which should be self executed when initilzing

* test: useState can be function

---------

Co-authored-by: answershuto <answershuto@gmail.com>
2023-03-09 03:52:43 -08:00
hzyhbk 4d55b983f4
fix: rax-compat usestate bug (#5567)
* fix: rax-compat usestate bug

* test: add test
2022-11-16 22:23:59 -08:00
染陌同学 36475937e8 Feat/define data loader (#643)
* feat: modify dataLoader

* feat: add type

* feat: add DataLoaderConfig

* feat: modify getData to defineDataLoader

* chore: remove defineDataLoader

* fix: fetcher shoule return promise

* fix: loader may be undefined

* fix: err loader config

* chore: modify example of pha

* feat: modify getData

* chore: modify type and mofiy options of init

* feat: modify fetcher to dataLoaderFetcher and add dataLoaderImport to entry

* chore: modify defaultDataLoaderFetcher

* chore: load data by route id

* feat: modify serverDataLoader and staticDataLoader

* feat: add fetcher when route change

* fix: deal with window undefined

* chore: modify type

* feat: try get data from cache

* feat: support useData

* feat: add defineStaticDataLoader and defineServerDataLoader

* chore: modify getData of example

* fix: should load data

* fix: fix ssg err

* fix: fix dataloader for ssg

* test: modify env of test

* fix: shoule clear cache when route changed

* fix: fix renderMode and add defult remder mode

* fix: add window

* test: add jsdom

* test: modify getData to dataLoader

* test: modify test of clientApp

* test: clear window after each test

* test: remove only

* test: remove only

* chore: modify appear

* fix: Try get data from cache when CSR

* chore: update lock

* chore: remove unused

* refactor: data loader (#685)

* refactor: set global fetcher

* refactor: set global fetcher

* fix: should not build react in data loader

* fix: test

* test: modify test

Co-authored-by: 水澜 <shuilan.cj@taobao.com>
Co-authored-by: ZeroLing <i@zeroling.com>
2022-11-15 10:33:11 +08:00
ClarkXia ad531405a8 test: improve test case (#497)
* test: improve test case

* test: compat win32

* test: test case

* test: add test case

* test: add test case

* test: test case for rax-compat

* test: test case for routes

* fix: types error

* fix: to strict equal

* chore: remove unused props

* fix: types

* test: test case for run client app

* chore: remove empty router

* test: test case of run server app

* chore: remove log

* chore: do not remove file by test case

* fix: remove document dependency when run client app

* chore: lint

* chore: remove config

* fix: lint

* chore: lint warning

* fix: test case

* chore: update unplugin
2022-11-15 10:30:52 +08:00
answershuto 69d1f8c997 test: modify .only 2022-11-14 19:53:28 +08:00
answershuto c8b2fe9493 test: add test for useState 2022-11-14 19:51:45 +08:00
answershuto 8010566506 test: add test for onAppear 2022-11-14 19:47:43 +08:00
answershuto 824388d3b0 test: add test to hooks 2022-11-14 19:44:08 +08:00