Open frederikhors opened 2 years ago
I'm using svelte-loadable and the below code but I'm getting the below warning and I feel this is not a good code.
svelte-loadable
Can you suggest me how to properly handle this?
The warning: <Create> was created with unknown prop 'playerID'
<Create> was created with unknown prop 'playerID'
The code:
<script lang="ts"> import Loadable from "svelte-loadable"; export let loader: string; // other code </script> <Loadable loader={loader === "player" ? () => import("$lib/../routes/players/create.svelte") : () => import("$lib/../routes/teams/create.svelte") // others here... } let:component > <svelte:component this={component} {formName} on:SOMETHING={handleSOMETHING} {/* other props here */} playerID={loader === "player" ? playerID : undefined} /> </Loadable>
Is there a way I can avoid the playerID prop based on which component I'm loading?
playerID
I'm using
svelte-loadable
and the below code but I'm getting the below warning and I feel this is not a good code.Can you suggest me how to properly handle this?
The warning:
<Create> was created with unknown prop 'playerID'
The code:
Is there a way I can avoid the
playerID
prop based on which component I'm loading?