1657891980
Điều gì sẽ xảy ra nếu tôi nói với bạn… rằng bạn cũng có thể học cách viết mã trong các đối tượng 3D trong React có thể khiến khách hàng kinh ngạc? Tìm hiểu những kiến thức cơ bản về trình kết xuất ba sợi phản ứng và chẳng bao lâu nữa, bạn có thể biến một trang tĩnh thành một phòng trưng bày nghệ thuật, một bản đồ tương tác hoặc bất kỳ thứ gì khác.
Đồ họa 3D hiện tạo ra trải nghiệm phong phú cho người dùng ứng dụng, cho phép doanh nghiệp tiếp cận làn sóng khách hàng mới thông qua hình ảnh đáng nhớ. Họ có thể đại diện cho các sản phẩm gần như thật như giày thể thao hoặc ba lô có thể được tùy chỉnh.
Kết xuất nâng cao có thể đưa bạn tham quan văn phòng công ty ảo hoặc thậm chí cho phép bạn hoàn thành các bài tập lái xe trong VR. Phòng trưng bày mà tôi đã đề cập trước đây đã cho tôi trải nghiệm ngoài cơ thể trong 10 phút.
Trải nghiệm sự mơ mộng của một không gian 3D phản ứng. Nguồn: Ripple
Từ các dự án phản ứng ba sợi mà tôi đã thấy trực tuyến, tôi nhận thấy họ nhằm mục đích làm cho sản phẩm / dịch vụ trở nên đáng nhớ hoặc dễ hiểu hơn. Nhưng bạn cũng có thể nắm bắt kỹ năng giao diện người dùng của mình để chỉ cần tạo một trang portfolio thử nghiệm như một tác phẩm nghệ thuật.
Thông thường, bạn sẽ sử dụng WebGL - API của trình duyệt để hiển thị 3D - điều này khá khó. Danh sách các định nghĩa cần thiết cho một khối lập phương thông thường thật điên rồ. Xem ví dụ WebGL này từ Mozilla.
Kết xuất dễ dàng hơn với thư viện cấp cao có tên là Three.js, cho phép bạn tạo môi trường 3D bằng cách sử dụng một API đơn giản hơn. Chỉ cần nhập một vài dòng mã và bạn có thể tạo một dự án React với một cảnh đơn giản lưu trữ khối lập phương.
// Setting up a scene that will be used to place objects
const scene = new THREE.Scene();
// Camera is the camera, eyes of your character
const camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 );
// We can set some WebGL parameters like antialiasing (softening sharp edges)
const renderer = new THREE.WebGLRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
// Boom, let's append our scene to the body
document.body.appendChild( renderer.domElement );
// Add light to the scene with Harry Potter's Lumos spell
const mainLight = new THREE.AmbientLight( '#FFFFFF' );
const pointLight = new THREE.PointLight( '#FFFFFF' );
scene.add( mainLight );
scene.add( pointLight );
Để xem bất cứ thứ gì, bạn cần khai báo khối lập phương của mình. Khá đơn giản.
// This is how we create simple cube
const geometry = new THREE.BoxGeometry();
const material = new THREE.MeshBasicMaterial( { color: '#BADA55' } );
const cube = new THREE.Mesh( geometry, material );
// And add it to the existing scene
scene.add( cube );
Vẫn không có gì? Được rồi, còn một bước nữa.
// recurring function that will render our scene and camera in WebGL renderer
// and request window to draw next frame of animation
const main = () => {
cube.rotation.x += 0.01;
cube.rotation.y += 0.01;
requestAnimationFrame(main);
renderer.render(scene, camera);
}
main();
Trong khi điều đó khá rõ ràng, phần còn lại của mã có kiểu 2000-2010 khó chịu này.
const btn = document.createElement('button');
btn.innerText = 'Click Me';
btn.onclick = () => console.log('I am imperative');
document.body.appendChild(btn);
Trộn các ứng dụng React hiện đại với mã giống jQuery không phải là ý tưởng tốt nhất để cải thiện chất lượng mã. Nhưng phản ứng-ba-sợi (R3F) là vị cứu tinh của chúng tôi ở đây. Trình kết xuất được khai báo giống như React , cho phép bạn tạo một thành phần độc lập của một cảnh 3D mà không gây phức tạp.
Thêm R3F
và Three.js
làm phụ thuộc vào ứng dụng Tạo React hiện có của bạn . Ngoài ra, sử dụng bộ khởi động TSH React với việc sử dụng yarn add three @react-three/fiber
hoặc npm install three @react-three/fiber –save
.
Tạo một thành phần chức năng trả về thiết lập cảnh với ánh sáng.
import { Canvas, Camera } from 'react-three-fiber'
const MyAwesomeDeclarativeScene = () => {
return (
<Canvas camera={{ position: [0, 0, 1], fov: 45 }}>
{/* We declare three.js object lowerCase without importing */}
<ambientLight intensity={0.3} color="#FFFFFF" />
<pointLight intensity={1.0} position={[10, 10, 10]} />
</Canvas>
);
}
ReactDOM.render(MyAwesomeDeclarativeScene, document.getElementById('root'));
Cảnh của bạn gần như đã sẵn sàng. Bây giờ, thêm khối lập phương, để chúng ta tiến về phía trước và khám phá các tùy chọn thú vị mà R3F cung cấp.
<mesh position={[0, 0, -1]}>
<boxGeometry args={[1, 1, 1]} />
<meshStandardMaterial color='#BADA55' />
</mesh>
Bạn đang sử dụng một thành phần Mesh React là một trình bao bọc cho các hình học Three.js khác nhau . Một trong số chúng boxGeometry
đại diện cho khối lập phương (hoặc như người ta nói - một cái hộp ). Thêm một trong những vật liệu Three.js có thể mô phỏng độ sâu để có thể nhìn thấy em bé tuyệt vời của bạn.
import { Canvas, Camera } from 'react-three-fiber'
const MyAwesomeDeclarativeScene = () => {
return (
<Canvas camera={{ position: [0, 0, 5], fov: 45 }}>
<ambientLight intensity={0.3} color="#FFFFFF" />
<pointLight intensity={1.0} position={[10, 10, 10]} />
<mesh position={[0, 0, -1]}>
<boxGeometry args={[1, 1, 1]} />
<meshStandardMaterial color='#BADA55' />
</mesh>
</Canvas>
);
}
ReactDOM.render(MyAwesomeDeclarativeScene, document.getElementById('root'));
Cách tạo 3D trong React mang lại cho bạn điều gì? Quyền truy cập trực tiếp vào tất cả chuông và còi của React! Bạn có thể xây dựng các thành phần tùy chỉnh, độc lập, sử dụng trạng thái phản ứng và làm mọi thứ mà React đã có một cách đơn giản và hiệu quả.
Một khách hàng bước ra khỏi tủ quần áo của bạn, yêu cầu một ứng dụng đơn giản với các hộp 3D xoay và có thể nhấp được. Người dùng có thể kiểm soát tốc độ quay. Bạn cần một bằng chứng về khái niệm được thực hiện cho bữa trưa (mà bạn trả tiền cho). Bạn sẽ tiếp cận dự án như thế nào?
Box
Sử dụng thành phần chức năng tùy chỉnh để chỉ định size
, color
và speedFactor
. Đoạn mã dưới đây chỉ định giá trị mặc định cho một số đạo cụ bổ sung có thể được thay đổi sau này - đừng lo lắng.
Sử dụng các useState
câu lệnh thông thường để theo dõi trạng thái hoạt động và di chuột. Thêm boxRef
để lưu trữ một tham chiếu lưới của bạn, vì nó cho phép bạn thao tác đối tượng thông qua useFrame
gọi lại. Vui lòng phân tích mã bên dưới theo tốc độ của bạn cho đến khi bạn hiểu nó.
import React, { useMemo, useRef, useState } from 'react';
import { MeshProps, useFrame } from 'react-three-fiber';
type BoxProps = {
size?: [number, number, number];
color?: string;
boxSpeed?: number;
} & MeshProps;
export const Box = ({ size = [1, 1, 1], color = '#FFFFFF', boxSpeed = 0.01, ...meshProps }: BoxProps) => {
const boxRef = useRef<MeshProps | null>(null);
const [isHovered, setIsHovered] = useState(false);
const [isSelected, setIsSelected] = useState(false);
// It is react-three-fiber way to trigger animation
// each frame we are changing x, y, z rotation of our box
useFrame(() => {
if (!boxRef.current) {
return;
}
boxRef.current.rotation.x += boxSpeed;
boxRef.current.rotation.y += boxSpeed;
});
// it is color memo which indicates state of an item
const calculatedColor = useMemo(() => {
if (isSelected && isHovered) {
return 'orange';
}
if (isSelected) {
return 'yellow';
}
if (isHovered && !isSelected) {
return 'red';
}
return color;
}, [color, isHovered, isSelected]);
return (
<mesh
{...meshProps}
ref={boxRef}
onPointerOver={() => setIsHovered(true)}
onPointerLeave={() => setIsHovered(false)}
onClick={() => setIsSelected((prev) => !prev)}
scale={isSelected ? [1.2, 1.2, 1.2] : [1, 1, 1]}
>
<boxGeometry args={size} />
<meshStandardMaterial color={calculatedColor} />
</mesh>
);
};
Vì vậy, cảnh của bạn bây giờ sử dụng thành phần có thể tùy chỉnh đáng kinh ngạc Box
. Để cung cấp cho người dùng điều khiển tốc độ quay, hãy thêm đầu vào phạm vi vào của bạn JSX structure
và của useState
, sẽ chứa thông tin vận tốc.
export const Scene = () => {
const [speedFactor, setSpeedFactor] = useState(1);
return (
<div>
<label htmlFor="speedFactor">
Speed factor:
<input
name="speedFactor"
type="range"
value={speedFactor}
min={1}
max={10}
step={0.1}
onChange={(e) => setSpeedFactor(+e.currentTarget.value)}
/>
</label>
<Canvas camera={{ position: [0, 0, 5], fov: 45 }}>
<ambientLight intensity={0.3} color="#FFFFFF" />
<pointLight intensity={1.0} position={[10, 10, 10]} />
<Box position={[-2, 1, 0]} rotation={[3, 1, 0]} color="hotpink" boxSpeed={0.02 * speedFactor} />
<Box position={[2, 1, 0]} rotation={[1, 1, 0]} color="cyan" boxSpeed={0.01 * speedFactor} />
<Box position={[0, -1, 0]} size={[1, 2, 2]} boxSpeed={0.005 * speedFactor} />
</Canvas>
</div>
);
};
Một lô mã nhỏ có thể chứa đựng rất nhiều điều kỳ diệu! Một khi bạn thành thạo react-three-fiber
, bạn sẽ sẵn sàng chơi với Three.js
và các tính năng phong phú của nó. Và kết quả?
Trình kết xuất có trải nghiệm riêng dành cho nhà phát triển vượt ra ngoài phong cách khai báo. R3F có hỗ trợ Typescript nổi bật giúp xem xét các loại của bạn mọi lúc.
Tối ưu hóa hiệu suất trong R3F là một công cụ thay đổi trò chơi thực sự, vì vòng lặp kết xuất của cảnh ba.js được tách biệt hoàn toàn khỏi Virtual DOM của React.
Bên cạnh đó, react-three-fiber còn có một hệ sinh thái thư viện tiện ích tuyệt vời. Có @ react-ba / pháo để tạo nội dung dựa trên vật lý hoặc @ react-three / drei . Cái thứ hai cung cấp rất nhiều chức năng ba sợi của React có thể tiết kiệm hàng giờ để tạo ra một cảnh 3D ngoạn mục được làm giàu với các hiệu ứng xử lý hậu kỳ tuyệt đẹp.
Liên kết: https://tsh.io/blog/react-three-fiber/
#react # 3d
1598839687
If you are undertaking a mobile app development for your start-up or enterprise, you are likely wondering whether to use React Native. As a popular development framework, React Native helps you to develop near-native mobile apps. However, you are probably also wondering how close you can get to a native app by using React Native. How native is React Native?
In the article, we discuss the similarities between native mobile development and development using React Native. We also touch upon where they differ and how to bridge the gaps. Read on.
Let’s briefly set the context first. We will briefly touch upon what React Native is and how it differs from earlier hybrid frameworks.
React Native is a popular JavaScript framework that Facebook has created. You can use this open-source framework to code natively rendering Android and iOS mobile apps. You can use it to develop web apps too.
Facebook has developed React Native based on React, its JavaScript library. The first release of React Native came in March 2015. At the time of writing this article, the latest stable release of React Native is 0.62.0, and it was released in March 2020.
Although relatively new, React Native has acquired a high degree of popularity. The “Stack Overflow Developer Survey 2019” report identifies it as the 8th most loved framework. Facebook, Walmart, and Bloomberg are some of the top companies that use React Native.
The popularity of React Native comes from its advantages. Some of its advantages are as follows:
Are you wondering whether React Native is just another of those hybrid frameworks like Ionic or Cordova? It’s not! React Native is fundamentally different from these earlier hybrid frameworks.
React Native is very close to native. Consider the following aspects as described on the React Native website:
Due to these factors, React Native offers many more advantages compared to those earlier hybrid frameworks. We now review them.
#android app #frontend #ios app #mobile app development #benefits of react native #is react native good for mobile app development #native vs #pros and cons of react native #react mobile development #react native development #react native experience #react native framework #react native ios vs android #react native pros and cons #react native vs android #react native vs native #react native vs native performance #react vs native #why react native #why use react native
1657891980
Điều gì sẽ xảy ra nếu tôi nói với bạn… rằng bạn cũng có thể học cách viết mã trong các đối tượng 3D trong React có thể khiến khách hàng kinh ngạc? Tìm hiểu những kiến thức cơ bản về trình kết xuất ba sợi phản ứng và chẳng bao lâu nữa, bạn có thể biến một trang tĩnh thành một phòng trưng bày nghệ thuật, một bản đồ tương tác hoặc bất kỳ thứ gì khác.
Đồ họa 3D hiện tạo ra trải nghiệm phong phú cho người dùng ứng dụng, cho phép doanh nghiệp tiếp cận làn sóng khách hàng mới thông qua hình ảnh đáng nhớ. Họ có thể đại diện cho các sản phẩm gần như thật như giày thể thao hoặc ba lô có thể được tùy chỉnh.
Kết xuất nâng cao có thể đưa bạn tham quan văn phòng công ty ảo hoặc thậm chí cho phép bạn hoàn thành các bài tập lái xe trong VR. Phòng trưng bày mà tôi đã đề cập trước đây đã cho tôi trải nghiệm ngoài cơ thể trong 10 phút.
Trải nghiệm sự mơ mộng của một không gian 3D phản ứng. Nguồn: Ripple
Từ các dự án phản ứng ba sợi mà tôi đã thấy trực tuyến, tôi nhận thấy họ nhằm mục đích làm cho sản phẩm / dịch vụ trở nên đáng nhớ hoặc dễ hiểu hơn. Nhưng bạn cũng có thể nắm bắt kỹ năng giao diện người dùng của mình để chỉ cần tạo một trang portfolio thử nghiệm như một tác phẩm nghệ thuật.
Thông thường, bạn sẽ sử dụng WebGL - API của trình duyệt để hiển thị 3D - điều này khá khó. Danh sách các định nghĩa cần thiết cho một khối lập phương thông thường thật điên rồ. Xem ví dụ WebGL này từ Mozilla.
Kết xuất dễ dàng hơn với thư viện cấp cao có tên là Three.js, cho phép bạn tạo môi trường 3D bằng cách sử dụng một API đơn giản hơn. Chỉ cần nhập một vài dòng mã và bạn có thể tạo một dự án React với một cảnh đơn giản lưu trữ khối lập phương.
// Setting up a scene that will be used to place objects
const scene = new THREE.Scene();
// Camera is the camera, eyes of your character
const camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 );
// We can set some WebGL parameters like antialiasing (softening sharp edges)
const renderer = new THREE.WebGLRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
// Boom, let's append our scene to the body
document.body.appendChild( renderer.domElement );
// Add light to the scene with Harry Potter's Lumos spell
const mainLight = new THREE.AmbientLight( '#FFFFFF' );
const pointLight = new THREE.PointLight( '#FFFFFF' );
scene.add( mainLight );
scene.add( pointLight );
Để xem bất cứ thứ gì, bạn cần khai báo khối lập phương của mình. Khá đơn giản.
// This is how we create simple cube
const geometry = new THREE.BoxGeometry();
const material = new THREE.MeshBasicMaterial( { color: '#BADA55' } );
const cube = new THREE.Mesh( geometry, material );
// And add it to the existing scene
scene.add( cube );
Vẫn không có gì? Được rồi, còn một bước nữa.
// recurring function that will render our scene and camera in WebGL renderer
// and request window to draw next frame of animation
const main = () => {
cube.rotation.x += 0.01;
cube.rotation.y += 0.01;
requestAnimationFrame(main);
renderer.render(scene, camera);
}
main();
Trong khi điều đó khá rõ ràng, phần còn lại của mã có kiểu 2000-2010 khó chịu này.
const btn = document.createElement('button');
btn.innerText = 'Click Me';
btn.onclick = () => console.log('I am imperative');
document.body.appendChild(btn);
Trộn các ứng dụng React hiện đại với mã giống jQuery không phải là ý tưởng tốt nhất để cải thiện chất lượng mã. Nhưng phản ứng-ba-sợi (R3F) là vị cứu tinh của chúng tôi ở đây. Trình kết xuất được khai báo giống như React , cho phép bạn tạo một thành phần độc lập của một cảnh 3D mà không gây phức tạp.
Thêm R3F
và Three.js
làm phụ thuộc vào ứng dụng Tạo React hiện có của bạn . Ngoài ra, sử dụng bộ khởi động TSH React với việc sử dụng yarn add three @react-three/fiber
hoặc npm install three @react-three/fiber –save
.
Tạo một thành phần chức năng trả về thiết lập cảnh với ánh sáng.
import { Canvas, Camera } from 'react-three-fiber'
const MyAwesomeDeclarativeScene = () => {
return (
<Canvas camera={{ position: [0, 0, 1], fov: 45 }}>
{/* We declare three.js object lowerCase without importing */}
<ambientLight intensity={0.3} color="#FFFFFF" />
<pointLight intensity={1.0} position={[10, 10, 10]} />
</Canvas>
);
}
ReactDOM.render(MyAwesomeDeclarativeScene, document.getElementById('root'));
Cảnh của bạn gần như đã sẵn sàng. Bây giờ, thêm khối lập phương, để chúng ta tiến về phía trước và khám phá các tùy chọn thú vị mà R3F cung cấp.
<mesh position={[0, 0, -1]}>
<boxGeometry args={[1, 1, 1]} />
<meshStandardMaterial color='#BADA55' />
</mesh>
Bạn đang sử dụng một thành phần Mesh React là một trình bao bọc cho các hình học Three.js khác nhau . Một trong số chúng boxGeometry
đại diện cho khối lập phương (hoặc như người ta nói - một cái hộp ). Thêm một trong những vật liệu Three.js có thể mô phỏng độ sâu để có thể nhìn thấy em bé tuyệt vời của bạn.
import { Canvas, Camera } from 'react-three-fiber'
const MyAwesomeDeclarativeScene = () => {
return (
<Canvas camera={{ position: [0, 0, 5], fov: 45 }}>
<ambientLight intensity={0.3} color="#FFFFFF" />
<pointLight intensity={1.0} position={[10, 10, 10]} />
<mesh position={[0, 0, -1]}>
<boxGeometry args={[1, 1, 1]} />
<meshStandardMaterial color='#BADA55' />
</mesh>
</Canvas>
);
}
ReactDOM.render(MyAwesomeDeclarativeScene, document.getElementById('root'));
Cách tạo 3D trong React mang lại cho bạn điều gì? Quyền truy cập trực tiếp vào tất cả chuông và còi của React! Bạn có thể xây dựng các thành phần tùy chỉnh, độc lập, sử dụng trạng thái phản ứng và làm mọi thứ mà React đã có một cách đơn giản và hiệu quả.
Một khách hàng bước ra khỏi tủ quần áo của bạn, yêu cầu một ứng dụng đơn giản với các hộp 3D xoay và có thể nhấp được. Người dùng có thể kiểm soát tốc độ quay. Bạn cần một bằng chứng về khái niệm được thực hiện cho bữa trưa (mà bạn trả tiền cho). Bạn sẽ tiếp cận dự án như thế nào?
Box
Sử dụng thành phần chức năng tùy chỉnh để chỉ định size
, color
và speedFactor
. Đoạn mã dưới đây chỉ định giá trị mặc định cho một số đạo cụ bổ sung có thể được thay đổi sau này - đừng lo lắng.
Sử dụng các useState
câu lệnh thông thường để theo dõi trạng thái hoạt động và di chuột. Thêm boxRef
để lưu trữ một tham chiếu lưới của bạn, vì nó cho phép bạn thao tác đối tượng thông qua useFrame
gọi lại. Vui lòng phân tích mã bên dưới theo tốc độ của bạn cho đến khi bạn hiểu nó.
import React, { useMemo, useRef, useState } from 'react';
import { MeshProps, useFrame } from 'react-three-fiber';
type BoxProps = {
size?: [number, number, number];
color?: string;
boxSpeed?: number;
} & MeshProps;
export const Box = ({ size = [1, 1, 1], color = '#FFFFFF', boxSpeed = 0.01, ...meshProps }: BoxProps) => {
const boxRef = useRef<MeshProps | null>(null);
const [isHovered, setIsHovered] = useState(false);
const [isSelected, setIsSelected] = useState(false);
// It is react-three-fiber way to trigger animation
// each frame we are changing x, y, z rotation of our box
useFrame(() => {
if (!boxRef.current) {
return;
}
boxRef.current.rotation.x += boxSpeed;
boxRef.current.rotation.y += boxSpeed;
});
// it is color memo which indicates state of an item
const calculatedColor = useMemo(() => {
if (isSelected && isHovered) {
return 'orange';
}
if (isSelected) {
return 'yellow';
}
if (isHovered && !isSelected) {
return 'red';
}
return color;
}, [color, isHovered, isSelected]);
return (
<mesh
{...meshProps}
ref={boxRef}
onPointerOver={() => setIsHovered(true)}
onPointerLeave={() => setIsHovered(false)}
onClick={() => setIsSelected((prev) => !prev)}
scale={isSelected ? [1.2, 1.2, 1.2] : [1, 1, 1]}
>
<boxGeometry args={size} />
<meshStandardMaterial color={calculatedColor} />
</mesh>
);
};
Vì vậy, cảnh của bạn bây giờ sử dụng thành phần có thể tùy chỉnh đáng kinh ngạc Box
. Để cung cấp cho người dùng điều khiển tốc độ quay, hãy thêm đầu vào phạm vi vào của bạn JSX structure
và của useState
, sẽ chứa thông tin vận tốc.
export const Scene = () => {
const [speedFactor, setSpeedFactor] = useState(1);
return (
<div>
<label htmlFor="speedFactor">
Speed factor:
<input
name="speedFactor"
type="range"
value={speedFactor}
min={1}
max={10}
step={0.1}
onChange={(e) => setSpeedFactor(+e.currentTarget.value)}
/>
</label>
<Canvas camera={{ position: [0, 0, 5], fov: 45 }}>
<ambientLight intensity={0.3} color="#FFFFFF" />
<pointLight intensity={1.0} position={[10, 10, 10]} />
<Box position={[-2, 1, 0]} rotation={[3, 1, 0]} color="hotpink" boxSpeed={0.02 * speedFactor} />
<Box position={[2, 1, 0]} rotation={[1, 1, 0]} color="cyan" boxSpeed={0.01 * speedFactor} />
<Box position={[0, -1, 0]} size={[1, 2, 2]} boxSpeed={0.005 * speedFactor} />
</Canvas>
</div>
);
};
Một lô mã nhỏ có thể chứa đựng rất nhiều điều kỳ diệu! Một khi bạn thành thạo react-three-fiber
, bạn sẽ sẵn sàng chơi với Three.js
và các tính năng phong phú của nó. Và kết quả?
Trình kết xuất có trải nghiệm riêng dành cho nhà phát triển vượt ra ngoài phong cách khai báo. R3F có hỗ trợ Typescript nổi bật giúp xem xét các loại của bạn mọi lúc.
Tối ưu hóa hiệu suất trong R3F là một công cụ thay đổi trò chơi thực sự, vì vòng lặp kết xuất của cảnh ba.js được tách biệt hoàn toàn khỏi Virtual DOM của React.
Bên cạnh đó, react-three-fiber còn có một hệ sinh thái thư viện tiện ích tuyệt vời. Có @ react-ba / pháo để tạo nội dung dựa trên vật lý hoặc @ react-three / drei . Cái thứ hai cung cấp rất nhiều chức năng ba sợi của React có thể tiết kiệm hàng giờ để tạo ra một cảnh 3D ngoạn mục được làm giàu với các hiệu ứng xử lý hậu kỳ tuyệt đẹp.
Liên kết: https://tsh.io/blog/react-three-fiber/
#react # 3d
1603489980
The first time I encountered Three.js I was blown away. It was hard to believe that the intricate 3D scenes I was looking at were not videos, they were being rendered directly in the browser! I wanted to make something with it, anything, just to understand what this technology was and where it fit in the ecosystem of HTML, CSS, and JS.
While there were a few exploratory attempts to incorporate Three.js into early iterations of my site, what’s left now is the spinning text mesh on my site’s home page. In this post I’ll walk through how we can replicate it using Three.js and React, using the amazing react-three-fiber library.
We’ll be making most of what you can see in the sandbox below, so if you’re following along, you’ll need a blank React project in order to use the code.
#software-development #react #threejs #react-three-fiber #javascript
1615544450
Since March 2020 reached 556 million monthly downloads have increased, It shows that React JS has been steadily growing. React.js also provides a desirable amount of pliancy and efficiency for developing innovative solutions with interactive user interfaces. It’s no surprise that an increasing number of businesses are adopting this technology. How do you select and recruit React.js developers who will propel your project forward? How much does a React developer make? We’ll bring you here all the details you need.
Facebook built and maintains React.js, an open-source JavaScript library for designing development tools. React.js is used to create single-page applications (SPAs) that can be used in conjunction with React Native to develop native cross-platform apps.
In the United States, the average React developer salary is $94,205 a year, or $30-$48 per hour, This is one of the highest among JavaScript developers. The starting salary for junior React.js developers is $60,510 per year, rising to $112,480 for senior roles.
In context of software developer wage rates, the United States continues to lead. In high-tech cities like San Francisco and New York, average React developer salaries will hit $98K and $114per year, overall.
However, the need for React.js and React Native developer is outpacing local labour markets. As a result, many businesses have difficulty locating and recruiting them locally.
It’s no surprise that for US and European companies looking for professional and budget engineers, offshore regions like India are becoming especially interesting. This area has a large number of app development companies, a good rate with quality, and a good pool of React.js front-end developers.
As per Linkedin, the country’s IT industry employs over a million React specialists. Furthermore, for the same or less money than hiring a React.js programmer locally, you may recruit someone with much expertise and a broader technical stack.
React is a very strong framework. React.js makes use of a powerful synchronization method known as Virtual DOM, which compares the current page architecture to the expected page architecture and updates the appropriate components as long as the user input.
React is scalable. it utilises a single language, For server-client side, and mobile platform.
React is steady.React.js is completely adaptable, which means it seldom, if ever, updates the user interface. This enables legacy projects to be updated to the most new edition of React.js without having to change the codebase or make a few small changes.
React is adaptable. It can be conveniently paired with various state administrators (e.g., Redux, Flux, Alt or Reflux) and can be used to implement a number of architectural patterns.
Is there a market for React.js programmers?
The need for React.js developers is rising at an unparalleled rate. React.js is currently used by over one million websites around the world. React is used by Fortune 400+ businesses and popular companies such as Facebook, Twitter, Glassdoor and Cloudflare.
As you’ve seen, locating and Hire React js Developer and Hire React Native developer is a difficult challenge. You will have less challenges selecting the correct fit for your projects if you identify growing offshore locations (e.g. India) and take into consideration the details above.
If you want to make this process easier, You can visit our website for more, or else to write a email, we’ll help you to finding top rated React.js and React Native developers easier and with strives to create this operation
#hire-react-js-developer #hire-react-native-developer #react #react-native #react-js #hire-react-js-programmer
1651604400
React Starter Kit is an opinionated boilerplate for web development built on top of Node.js, Express, GraphQL and React, containing modern web development tools such as Webpack, Babel and Browsersync. Helping you to stay productive following the best practices. A solid starting point for both professionals and newcomers to the industry.
See getting started guide, demo, docs, roadmap | Join #react-starter-kit chat room on Gitter | Visit our sponsors:
The master
branch of React Starter Kit doesn't include a Flux implementation or any other advanced integrations. Nevertheless, we have some integrations available to you in feature branches that you can use either as a reference or merge into your project:
master
)feature/redux
)feature/apollo
)master
)You can see status of most reasonable merge combination as PRs labeled as TRACKING
If you think that any of these features should be on master
, or vice versa, some features should removed from the master
branch, please let us know. We love your feedback!
React Starter Kit
| React Static Boilerplate
| ASP.NET Core Starter Kit
| |
---|---|---|---|
App type | Isomorphic (universal) | Single-page application | Single-page application |
Frontend | |||
Language | JavaScript (ES2015+, JSX) | JavaScript (ES2015+, JSX) | JavaScript (ES2015+, JSX) |
Libraries | React, History, Universal Router | React, History, Redux | React, History, Redux |
Routes | Imperative (functional) | Declarative | Declarative, cross-stack |
Backend | |||
Language | JavaScript (ES2015+, JSX) | n/a | C#, F# |
Libraries | Node.js, Express, Sequelize, GraphQL | n/a | ASP.NET Core, EF Core, ASP.NET Identity |
SSR | Yes | n/a | n/a |
Data API | GraphQL | n/a | Web API |
♥ React Starter Kit? Help us keep it alive by donating funds to cover project expenses via OpenCollective or Bountysource!
Anyone and everyone is welcome to contribute to this project. The best way to start is by checking our open issues, submit a new issue or feature request, participate in discussions, upvote or downvote the issues you like or dislike, send pull requests.
Copyright © 2014-present Kriasoft, LLC. This source code is licensed under the MIT license found in the LICENSE.txt file. The documentation to the project is licensed under the CC BY-SA 4.0 license.
Author: kriasoft
Source Code: https://github.com/kriasoft/react-starter-kit
License: MIT License