Skip to content
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 documentation details #5922

Merged
merged 48 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
f074923
changix jsx to tsx
xnameTM Apr 8, 2024
5263178
compiling and formating jsx
xnameTM Apr 8, 2024
70ec8d3
Changes from comments
xnameTM Apr 9, 2024
ab3a12d
fixing prettier
xnameTM Apr 9, 2024
0543d04
removing any
xnameTM Apr 9, 2024
bfbebcd
src alias
xnameTM Apr 9, 2024
124035e
simplify map func
xnameTM Apr 9, 2024
5c43f6b
changing types in ScrollViewOffset example
xnameTM Apr 9, 2024
477f9f9
adding playground to withDecay subpage
xnameTM Apr 15, 2024
6d57b60
fixing dragable Reanimated text
xnameTM Apr 15, 2024
9aafdc9
fixed thumbs in playgrounds and added responsive animation in TimingB…
xnameTM Apr 15, 2024
98105e2
changing React.ReactNodes to React.FCs
xnameTM Apr 16, 2024
9df2fb6
Merge branch main into @xnameTM/convert-ts-to-js
xnameTM Apr 17, 2024
5743e57
fixing yarn in docs
xnameTM Apr 17, 2024
0ce079e
Merge branch 'main' into @xnameTM/convert-ts-to-js
xnameTM Apr 17, 2024
dbb011a
adding yarn 1.22.22 in docs
xnameTM Apr 17, 2024
cb8891a
merge
xnameTM Apr 17, 2024
4467cb9
Merge branch '@xnameTM/convert-ts-to-js' of https://github.com/xnameT…
xnameTM Apr 17, 2024
6fab7a2
merge main into this branch
xnameTM Apr 17, 2024
e4b0b3a
merge main into this branc
xnameTM Apr 17, 2024
a8a6fa1
adding playground to withDecay subpage
xnameTM Apr 15, 2024
89d2989
fixing dragable Reanimated text
xnameTM Apr 15, 2024
90d0c18
fixed thumbs in playgrounds and added responsive animation in TimingB…
xnameTM Apr 15, 2024
b533997
changing React.ReactNodes to React.FCs
xnameTM Apr 16, 2024
bcece55
adding responsiveness to examples
xnameTM Apr 18, 2024
f4cd824
adding responsiveness to examples
xnameTM Apr 18, 2024
0a49459
fixed DelayText example
xnameTM Apr 19, 2024
2ada83b
Rewrite examples in documentation to TypeScript (#5873)
xnameTM Apr 19, 2024
89a7cfa
merge
xnameTM Apr 19, 2024
235719e
Merge branch 'main' into @xnameTM/convert-ts-to-js-2
xnameTM Apr 19, 2024
fb55f90
yarn.lock
xnameTM Apr 19, 2024
467b27a
Merge branch '@xnameTM/convert-ts-to-js-2' into @xnameTM/fixing-details
xnameTM Apr 19, 2024
a012dc4
merge main
xnameTM Apr 26, 2024
3fd2171
lint
xnameTM Apr 26, 2024
1f0e717
cspell
xnameTM Apr 26, 2024
07c3ccd
cspell
xnameTM Apr 26, 2024
eb18fe5
removing useDecaPlayground
xnameTM Apr 26, 2024
dd21d9b
Merge branch 'main' into @xnameTM/fixing-details
xnameTM Apr 26, 2024
d5d2639
removing useMemo
xnameTM Apr 26, 2024
80bb6e4
Adding playground to withDecay subpage (#5939)
xnameTM May 22, 2024
6ea9685
Adding playground to withRepeat subpage (#5917)
xnameTM May 22, 2024
5dacf5b
Change value in `useReducedMotion`
patrycjakalinska May 22, 2024
266ffea
Change of values
patrycjakalinska May 22, 2024
9223136
Revert margin change
patrycjakalinska May 22, 2024
0485400
Revert selectionBox fix
patrycjakalinska May 27, 2024
869015c
Add margin on phone
patrycjakalinska May 27, 2024
b55fb62
Changes to useClamp playground
patrycjakalinska May 27, 2024
bf4608c
Fix for useInterpolateColorPlayground
patrycjakalinska May 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@
"pressable",
"inout",
"workletizes",
"worklets"
"worklets",
"runtimes",
"overdamped",
"automagically",
"threejs",
"nomalized"
],
"ignorePaths": ["node_modules", "docs/src/components/Testimonials"],
"useGitignore": true
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/advanced/measure.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ or returns `null` when the measurement couldn't be performed.
import MeasureBasic from '@site/src/examples/MeasureBasic';
import MeasureBasicSrc from '!!raw-loader!@site/src/examples/MeasureBasic';

<InteractiveExample src={MeasureBasicSrc} component={<MeasureBasic />} />
<InteractiveExample src={MeasureBasicSrc} component={MeasureBasic} />

## Remarks

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/advanced/setNativeProps.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ An object with properties you want to update. These could be both style props (e
import SetNativeProps from '@site/src/examples/SetNativeProps';
import SetNativePropsSrc from '!!raw-loader!@site/src/examples/SetNativeProps';

<InteractiveExample src={SetNativePropsSrc} component={<SetNativeProps />} />
<InteractiveExample src={SetNativePropsSrc} component={SetNativeProps} />

## Remarks

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/advanced/useAnimatedReaction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ import AnimatedReactionMeasureSrc from '!!raw-loader!@site/src/examples/Animated

<InteractiveExample
src={AnimatedReactionMeasureSrc}
component={<AnimatedReactionMeasure />}
component={AnimatedReactionMeasure}
/>

## Remarks
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/advanced/useFrameCallback.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import FrameCallbackSimpleSrc from '!!raw-loader!@site/src/examples/FrameCallbac

<InteractiveExample
src={FrameCallbackSimpleSrc}
component={<FrameCallbackSimple />}
component={FrameCallbackSimple}
/>

## Reference
Expand Down Expand Up @@ -87,7 +87,7 @@ import FrameCallbackDinoSrc from '!!raw-loader!@site/src/examples/FrameCallbackD

<InteractiveExample
src={FrameCallbackDinoSrc}
component={<FrameCallbackDino />}
component={FrameCallbackDino}
label="Tap to jump"
/>

Expand Down
8 changes: 6 additions & 2 deletions docs/docs/animations/withDecay.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import DecayBasicSrc from '!!raw-loader!@site/src/examples/DecayBasic';

<InteractiveExample
src={DecayBasicSrc}
component={<DecayBasic />}
component={DecayBasic}
label="Grab and drag the square"
/>

Expand Down Expand Up @@ -62,6 +62,10 @@ enum ReduceMotion {

The decay animation configuration.

import { useDecayPlayground } from '@site/src/components/InteractivePlayground';

<InteractivePlayground usePlayground={useDecayPlayground} />

Available properties:

| Name | Type | Default | Description |
Expand Down Expand Up @@ -89,7 +93,7 @@ import DecayTrainSrc from '!!raw-loader!@site/src/examples/DecayTrain';

<InteractiveExample
src={DecayTrainSrc}
component={<DecayTrain />}
component={DecayTrain}
label="Grab and drag the train"
/>

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/animations/withDelay.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ A parameter that determines how the animation responds to the device's reduced m
import DelayText from '@site/src/examples/DelayText';
import DelayTextSrc from '!!raw-loader!@site/src/examples/DelayText';

<InteractiveExample src={DelayTextSrc} component={<DelayText />} />
<InteractiveExample src={DelayTextSrc} component={DelayText} />

## Platform compatibility

Expand Down
8 changes: 6 additions & 2 deletions docs/docs/animations/withRepeat.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ sidebar_position: 5
import RepeatBasic from '@site/src/examples/RepeatBasic';
import RepeatBasicSrc from '!!raw-loader!@site/src/examples/RepeatBasic';

<InteractiveExample src={RepeatBasicSrc} component={<RepeatBasic />} />
<InteractiveExample src={RepeatBasicSrc} component={RepeatBasic} />

## Reference

Expand Down Expand Up @@ -71,6 +71,10 @@ A function called on animation complete. In case the animation is cancelled, the

A parameter that determines how the animation responds to the device's reduced motion accessibility setting.

import { useRepeatPlayground } from '@site/src/components/InteractivePlayground';

<InteractivePlayground usePlayground={useRepeatPlayground} />

### Returns

`withRepeat` returns an [animation object](/docs/fundamentals/glossary#animation-object) which holds the current state of the animation. It can be either assigned directly to a [shared value](/docs/fundamentals/glossary#shared-value) or can be used as a value for a style object returned from [useAnimatedStyle](docs/core/useAnimatedStyle).
Expand All @@ -80,7 +84,7 @@ A parameter that determines how the animation responds to the device's reduced m
import SequenceWobble from '@site/src/examples/SequenceWobble';
import SequenceWobbleSrc from '!!raw-loader!@site/src/examples/SequenceWobble';

<InteractiveExample src={SequenceWobbleSrc} component={<SequenceWobble />} />
<InteractiveExample src={SequenceWobbleSrc} component={SequenceWobble} />

## Remarks

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/animations/withSequence.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ sidebar_position: 4
import SequenceBasic from '@site/src/examples/SequenceBasic';
import SequenceBasicSrc from '!!raw-loader!@site/src/examples/SequenceBasic';

<InteractiveExample src={SequenceBasicSrc} component={<SequenceBasic />} />
<InteractiveExample src={SequenceBasicSrc} component={SequenceBasic} />

## Reference

Expand Down Expand Up @@ -61,7 +61,7 @@ Any number of [animation objects](docs/fundamentals/glossary#animation-object) t
import SequenceWobble from '@site/src/examples/SequenceWobble';
import SequenceWobbleSrc from '!!raw-loader!@site/src/examples/SequenceWobble';

<InteractiveExample src={SequenceWobbleSrc} component={<SequenceWobble />} />
<InteractiveExample src={SequenceWobbleSrc} component={SequenceWobble} />

## Platform compatibility

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/animations/withSpring.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ sidebar_position: 2
import SpringBasic from '@site/src/examples/SpringBasic';
import SpringBasicSrc from '!!raw-loader!@site/src/examples/SpringBasic';

<InteractiveExample src={SpringBasicSrc} component={<SpringBasic />} />
<InteractiveExample src={SpringBasicSrc} component={SpringBasic} />

## Reference

Expand Down Expand Up @@ -116,7 +116,7 @@ A function called upon animation completion. If the animation is cancelled, the
import SpringCarousel from '@site/src/examples/SpringCarousel';
import SpringCarouselSrc from '!!raw-loader!@site/src/examples/SpringCarousel';

<InteractiveExample src={SpringCarouselSrc} component={<SpringCarousel />} />
<InteractiveExample src={SpringCarouselSrc} component={SpringCarousel} />

## Remarks

Expand Down
6 changes: 3 additions & 3 deletions docs/docs/animations/withTiming.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ sidebar_position: 1
import TimingBasic from '@site/src/examples/TimingBasic';
import TimingBasicSrc from '!!raw-loader!@site/src/examples/TimingBasic';

<InteractiveExample src={TimingBasicSrc} component={<TimingBasic />} />
<InteractiveExample src={TimingBasicSrc} component={TimingBasic} />

## Reference

Expand Down Expand Up @@ -84,7 +84,7 @@ import TimingEasingCompareSrc from '!!raw-loader!@site/src/examples/TimingEasing

<InteractiveExample
src={TimingEasingCompareSrc}
component={<TimingEasingCompare />}
component={TimingEasingCompare}
/>

Reanimated provides a selection of ready-to-use easing functions in the `Easing` module. You can find a visualization of some common easing functions at [http://easings.net/](http://easings.net/).
Expand Down Expand Up @@ -133,7 +133,7 @@ A function called upon animation completion. If the animation is cancelled, the
import TimingTabs from '@site/src/examples/TimingTabs';
import TimingTabsSrc from '!!raw-loader!@site/src/examples/TimingTabs';

<InteractiveExample src={TimingTabsSrc} component={<TimingTabs />} />
<InteractiveExample src={TimingTabsSrc} component={TimingTabs} />

## Remarks

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/core/cancelAnimation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ The shared value of a running animation that you want to cancel. If no animation
import CancelAnimation from '@site/src/examples/CancelAnimation';
import CancelAnimationSrc from '!!raw-loader!@site/src/examples/CancelAnimation';

<InteractiveExample src={CancelAnimationSrc} component={<CancelAnimation />} />
<InteractiveExample src={CancelAnimationSrc} component={CancelAnimation} />

## Remarks

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/core/createAnimatedComponent.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import CreateAnimatedComponentSrc from '!!raw-loader!@site/src/examples/CreateAn

<InteractiveExample
src={CreateAnimatedComponentSrc}
component={<CreateAnimatedComponent />}
component={CreateAnimatedComponent}
showCode
/>

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/core/useAnimatedProps.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ import AnimatedPropAdapterSrc from '!!raw-loader!@site/src/examples/AnimatedProp
import AnimatingProps from '@site/src/examples/AnimatingProps';
import AnimatingPropsSrc from '!!raw-loader!@site/src/examples/AnimatingProps';

<InteractiveExample src={AnimatingPropsSrc} component={<AnimatingProps />} />
<InteractiveExample src={AnimatingPropsSrc} component={AnimatingProps} />

## Remarks

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/core/useAnimatedStyle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ import AnimatingStylesSrc from '!!raw-loader!@site/src/examples/AnimatingStyles'

<InteractiveExample
src={AnimatingStylesSrc}
component={<AnimatingStyles />}
component={AnimatingStyles}
showCode
/>

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/core/useDerivedValue.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Only relevant when using Reanimated [without the Babel plugin on the Web](https:
import DerivedValue from '@site/src/examples/DerivedValue';
import DerivedValueSrc from '!!raw-loader!@site/src/examples/DerivedValue';

<InteractiveExample src={DerivedValueSrc} component={<DerivedValue />} />
<InteractiveExample src={DerivedValueSrc} component={DerivedValue} />

## Remarks

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/core/useSharedValue.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Values stored in shared values can be accessed and modified by their `.value` pr
import SharedValue from '@site/src/examples/SharedValue';
import SharedValueSrc from '!!raw-loader!@site/src/examples/SharedValue';

<InteractiveExample src={SharedValueSrc} component={<SharedValue />} showCode />
<InteractiveExample src={SharedValueSrc} component={SharedValue} showCode />

## Remarks

Expand Down
5 changes: 1 addition & 4 deletions docs/docs/device/useReducedMotion.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ function App() {
import UseReducedMotion from '@site/src/examples/UseReducedMotion';
import UseReducedMotionSrc from '!!raw-loader!@site/src/examples/UseReducedMotion';

<InteractiveExample
src={UseReducedMotionSrc}
component={<UseReducedMotion />}
/>
<InteractiveExample src={UseReducedMotionSrc} component={UseReducedMotion} />

## Remarks

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/fundamentals/animating-styles-and-props.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ import AnimatingStylesSrc from '!!raw-loader!@site/src/examples/AnimatingStyles'

You can see it in action in the example below:

<InteractiveExample src={AnimatingStylesSrc} component={<AnimatingStyles />} />
<InteractiveExample src={AnimatingStylesSrc} component={AnimatingStyles} />

## Animating props

Expand Down Expand Up @@ -119,7 +119,7 @@ In a function which `useAnimatedProps` takes as an argument, we return an object

Check out the full example below:

<InteractiveExample src={AnimatingPropsSrc} component={<AnimatingProps />} />
<InteractiveExample src={AnimatingPropsSrc} component={AnimatingProps} />

## Summary

Expand Down
8 changes: 4 additions & 4 deletions docs/docs/fundamentals/applying-modifiers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import TimingSrc from '!!raw-loader!@site/src/examples/ApplyingModifiers/Timing'

<CollapsibleCode showLines={[8, 32]} src={TimingSrc} />

<InteractiveExample src={TimingSrc} component={<Timing />} />
<InteractiveExample src={TimingSrc} component={Timing} />

## Repeating an animation

Expand Down Expand Up @@ -49,7 +49,7 @@ import RepeatSrc from '!!raw-loader!@site/src/examples/ApplyingModifiers/Repeat'

When we run this code we can see that the box jiggles left to right between the set offset and a starting position. After the animation finishes the box doesn't come back to its initial place. It's not really how we imagined a shake animation but we'll get there in a second!

<InteractiveExample src={RepeatSrc} component={<Repeat />} />
<InteractiveExample src={RepeatSrc} component={Repeat} />

## Running animations in a sequence

Expand All @@ -75,7 +75,7 @@ import SequenceSrc from '!!raw-loader!@site/src/examples/ApplyingModifiers/Seque

<CollapsibleCode showLines={[18, 32]} src={SequenceSrc} />

<InteractiveExample src={SequenceSrc} component={<Sequence />} />
<InteractiveExample src={SequenceSrc} component={Sequence} />

## Starting the animation with delay

Expand All @@ -100,7 +100,7 @@ import DelaySrc from '!!raw-loader!@site/src/examples/ApplyingModifiers/Delay';

import Delay from '@site/src/examples/ApplyingModifiers/Delay';

<InteractiveExample src={DelaySrc} component={<Delay />} />
<InteractiveExample src={DelaySrc} component={Delay} />

## Summary

Expand Down
7 changes: 2 additions & 5 deletions docs/docs/fundamentals/customizing-animation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import TimingEasingCompareSrc from '!!raw-loader!@site/src/examples/TimingEasing

<InteractiveExample
src={TimingEasingCompareSrc}
component={<TimingEasingCompare />}
component={TimingEasingCompare}
/>

Reanimated comes with a handful of predefined easing functions. You can play around with them in the interactive playground below or check the full [`withTiming` API reference](/docs/animations/withTiming).
Expand Down Expand Up @@ -69,10 +69,7 @@ The mass of a spring influences how hard is it to make an object move and to bri
import SpringMassCompare from '@site/src/examples/SpringMassCompare';
import SpringMassCompareSrc from '!!raw-loader!@site/src/examples/SpringMassCompare';

<InteractiveExample
src={SpringMassCompareSrc}
component={<SpringMassCompare />}
/>
<InteractiveExample src={SpringMassCompareSrc} component={SpringMassCompare} />

Stiffness affects how bouncy the spring is. As an example, think about the difference between a steel spring (with very high stiffness) and a spring made out of soft plastic (with low stiffness).

Expand Down
6 changes: 3 additions & 3 deletions docs/docs/fundamentals/handling-gestures.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ And that's it! Pretty straightforward, isn't it? Let's see it in the full glory

<InteractiveExample
src={TapGestureSrc}
component={<TapGesture />}
component={TapGesture}
label="Tap the circle"
/>

Expand All @@ -78,7 +78,7 @@ You can play around with the example below and see how the circle changes and re

<InteractiveExample
src={PanGestureSrc}
component={<PanGesture />}
component={PanGesture}
label="Grab and drag the circle"
/>

Expand All @@ -101,7 +101,7 @@ Play around and see how the square decelerates when let go with some speed!

<InteractiveExample
src={DecayBasicSrc}
component={<DecayBasic />}
component={DecayBasic}
label="Grab and release the square"
/>

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/fundamentals/your-first-animation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ And voilà, we've made our first animation using Reanimated! You can see how it
import FirstAnimation from '@site/src/examples/FirstAnimation';
import FirstAnimationSrc from '!!raw-loader!@site/src/examples/FirstAnimation';

<InteractiveExample src={FirstAnimationSrc} component={<FirstAnimation />} />
<InteractiveExample src={FirstAnimationSrc} component={FirstAnimation} />

## Summary

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/scroll/scrollTo.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Whether the scroll should be smooth (`true`) or instant (`false`).
import ScrollTo from '@site/src/examples/ScrollTo';
import ScrollToSrc from '!!raw-loader!@site/src/examples/ScrollTo';

<InteractiveExample src={ScrollToSrc} component={<ScrollTo />} />
<InteractiveExample src={ScrollToSrc} component={ScrollTo} />

## Remarks

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/scroll/useScrollViewOffset.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import ScrollViewOffsetSrc from '!!raw-loader!@site/src/examples/ScrollViewOffse

<InteractiveExample
src={ScrollViewOffsetSrc}
component={<ScrollViewOffset />}
component={ScrollViewOffset}
showCode
/>

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/threading/runOnJS.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Don't forget to call the function returned from `runOnJS`.
import RunOnJS from '@site/src/examples/RunOnJS';
import RunOnJSSrc from '!!raw-loader!@site/src/examples/RunOnJS';

<InteractiveExample src={RunOnJSSrc} component={<RunOnJS />} />
<InteractiveExample src={RunOnJSSrc} component={RunOnJS} />

## Remarks

Expand Down