FAQ
Can I use React features like Hooks, Redux, and Dva?
Yes, you can.
Can I use React DOM libraries like Ant Design and Ant Design Mobile?
No, you cannot.
The MiniApp does not have a DOM, so it does not support any React DOM based UI libraries.
How can I quickly develop UI components without the ready-to-use web UI libraries?
Ray supports native component libraries. For more information, see Hybrid Development.
The page lifecycle is not invoked due to the use of a higher-order component (HOC). How to fix it?
If you use the connect function from Redux, set the option.forwardRef of connect to true. For more information, see React Redux. This solution also works for HOC from other third-party libraries.
For class components, Ray gets the page lifecycle through ref. If a page component is wrapped with a HOC, Ray gets the outermost component of the HOC instead of the wrapped component. In this case, React.forwardRef is required to forward ref to the internal component.
I get an error saying Path Not Found after the miniapp is built. How to fix it?
Delete the build directory and try to build the miniapp again.
What is the difference between Ray and Taro?
Taro 3.0 works basically the same way as Ray. They differ in two aspects:
- Multi-platform compatibility: Ray focuses on the key features of the framework and provides a homogeneous multi-platform mechanism with a lean multi-platform implementation (@ray-js/components) to help you build MiniApps across different platforms as needed.
- React-focused: React is one of the most popular and widely used frontend frameworks, and React will stay focused on the React stacks to provide more innovative features.