Show and ShowButton components using the resource prop. This prop defines the redirection endpoint for the ShowButton and the resource information for the Show component.Show component, you can specify the resource like this:Show component reads the resource information from the categories resource.ShowButton component, you can specify the resource like this:show method of useNavigation and then redirect the app to the show action path of the categories resource, filling the necessary parameters in the route.resourceNameOrRouteName prop is deprecated and you should use the resource prop instead.Note: you can ask me a follow up question by @ mentioning me again useShow hook, you can specify the resource (which is usually used as an API endpoint path) by passing it as a parameter. Here's an example:useShow hook will fetch data from the "categories" resource.resource and id, you can do it like this:useShow hook will fetch data from the "custom-resource" resource with the specified id.setShowId function to set the id value:useShow hook will fetch data from the "custom-resource" resource with the id set to "123".Note: you can ask me a follow up question by @ mentioning me again .env.local file. This file should be placed in your project root directory. The variables in this file will be loaded into the Node.js process and can be accessed via process.env..env.local file:NEXT_PUBLIC_ prefix to the variable name in the .env.local file. For example:Note: you can ask me a follow up question by @ mentioning me again args directive in your docker-compose.yml file. Here's an example:API_URL and API_KEY are environment variables that will be passed to the Docker build process. These variables can be accessed in your Dockerfile using the ARG instruction:API_URL and API_KEY are build-time variables that are passed to the npm run build command. The ENV instruction is used to set these variables as environment variables in the Docker container.process.env:REACT_APP_ to ensure they are embedded into the build.API_URL and API_KEY) set in the shell environment where you run docker-compose up.Note: you can ask me a follow up question by @ mentioning me again API_URL and API_KEY are environment variables that will be available in your application and can be accessed via process.env.npm run refine dev --port 3001 to run the app on port 3001.Note: you can ask me a follow up question by @ mentioning me again categoriescategoriesshowshowuseNavigationresourceNameOrRouteNameuseShowuseShowuseShowuseShowsetShowIdNEXT_PUBLIC_argsAPI_URLAPI_URLAPI_URLAPI_URLAPI_KEYAPI_KEYAPI_KEYAPI_KEYARGENVREACT_APP_docker-compose upnpm run refine dev --port 30013001import { Show } from "@refinedev/chakra-ui";
const CustomPage: React.FC = () => {
return (
<Show resource="categories">
<p>Rest of your page here</p>
</Show>
);
}; import { ShowButton } from "@refinedev/mantine";
const MyShowComponent = () => {
return <ShowButton resource="categories" recordItemId="2" />;
}; useShow({
resource: "categories",
}); import { useShow, useParsed } from "@refinedev/core";
const { id } = useParsed();
useShow({
resource: "custom-resource",
id,
}); import { useShow } from "@refinedev/core";
const { setShowId } = useShow({
resource: "custom-resource",
});
setShowId("123"); API_URL='<https://dev.to/api/api/articles/{id}/unpublish'>
API_KEY='your_secret_api_key_here' process.env.API_URL
process.env.API_KEYNEXT_PUBLIC_GOOGLE_ANALYTICS_ID='your_google_analytics_id_here' process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS_IDversion: '3'
services:
web:
build:
context: .
args:
- API_URL
- API_KEYFROM node:14
WORKDIR /usr/src/app
ARG API_URL
ARG API_KEY
ENV REACT_APP_API_URL=$API_URL
ENV REACT_APP_API_KEY=$API_KEY
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run buildconsole.log(process.env.REACT_APP_API_URL);
console.log(process.env.REACT_APP_API_KEY);API_URL=<https://myapi.com> API_KEY=123456 npm run refine dev